summaryrefslogtreecommitdiffstats
path: root/include/sound/ak4114.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-05-12 10:47:16 +0200
committerTakashi Iwai <tiwai@suse.de>2017-05-17 07:13:03 +0200
commit239480ab92a52544748749c8445f4e12495e4f69 (patch)
treef218eef1a263ef505a7005166ab1dcd412fc230b /include/sound/ak4114.h
parentALSA: vxpocket: Use container_of() (diff)
downloadlinux-239480ab92a52544748749c8445f4e12495e4f69.tar.xz
linux-239480ab92a52544748749c8445f4e12495e4f69.zip
ALSA: ak411x: Use array instead of offsetof()
The ak4113, ak4114 and ak4117 i2c drivers have some tricky codes to access the struct fields in the callback. This can be simplified by replacing the struct fields with the array. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/ak4114.h')
-rw-r--r--include/sound/ak4114.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index b6feb7e225f2..39df064c82fc 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -163,6 +163,14 @@
typedef void (ak4114_write_t)(void *private_data, unsigned char addr, unsigned char data);
typedef unsigned char (ak4114_read_t)(void *private_data, unsigned char addr);
+enum {
+ AK4114_PARITY_ERRORS,
+ AK4114_V_BIT_ERRORS,
+ AK4114_QCRC_ERRORS,
+ AK4114_CCRC_ERRORS,
+ AK4114_NUM_ERRORS
+};
+
struct ak4114 {
struct snd_card *card;
ak4114_write_t * write;
@@ -176,10 +184,7 @@ struct ak4114 {
struct snd_kcontrol *kctls[AK4114_CONTROLS];
struct snd_pcm_substream *playback_substream;
struct snd_pcm_substream *capture_substream;
- unsigned long parity_errors;
- unsigned long v_bit_errors;
- unsigned long qcrc_errors;
- unsigned long ccrc_errors;
+ unsigned long errors[AK4114_NUM_ERRORS];
unsigned char rcs0;
unsigned char rcs1;
struct delayed_work work;