]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec()
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 19 Jun 2014 05:50:01 +0000 (07:50 +0200)
committerMark Brown <broonie@linaro.org>
Thu, 19 Jun 2014 09:55:38 +0000 (10:55 +0100)
We now have a generic helper function to cast from a DAPM context to a CODEC.
Make use of it in the places which previously open-coded it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8996.c

index eca983fad8918e2599b5c990eada31b2147ddc17..42a3ff3a1b68e4117dc7b3479d6ac480466b64e3 100644 (file)
@@ -735,8 +735,7 @@ WM5100_MIXER_CONTROLS("LHPF4", WM5100_HPLP4MIX_INPUT_1_SOURCE),
 static void wm5100_seq_notifier(struct snd_soc_dapm_context *dapm,
                                enum snd_soc_dapm_type event, int subseq)
 {
-       struct snd_soc_codec *codec = container_of(dapm,
-                                                  struct snd_soc_codec, dapm);
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
        struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec);
        u16 val, expect, i;
 
index b0084a127d18c6214636ed96ef40f3ae8b4b56ae..2116e79085ecebff1c3997178ab477ac732d19b5 100644 (file)
@@ -281,8 +281,7 @@ static int wm8903_dcs_event(struct snd_soc_dapm_widget *w,
 static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
                                enum snd_soc_dapm_type event, int subseq)
 {
-       struct snd_soc_codec *codec = container_of(dapm,
-                                                  struct snd_soc_codec, dapm);
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
        struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
        int dcs_mode = WM8903_DCS_MODE_WRITE_STOP;
        int i, val;
index c6cbb3b8ace96a8d462159d975ae5525b5ac7ed4..8f4d2cddb962244b9570c8a31537a0b5dcbb8e7a 100644 (file)
@@ -690,8 +690,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask)
 static void wm8996_seq_notifier(struct snd_soc_dapm_context *dapm,
                                enum snd_soc_dapm_type event, int subseq)
 {
-       struct snd_soc_codec *codec = container_of(dapm,
-                                                  struct snd_soc_codec, dapm);
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm);
        struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
        u16 val, mask;