* [PATCH] ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec()
@ 2014-06-19 5:50 Lars-Peter Clausen
2014-06-19 8:05 ` Charles Keepax
2014-06-19 9:56 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2014-06-19 5:50 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood
Cc: Charles Keepax, patches, alsa-devel, Lars-Peter Clausen
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>
---
sound/soc/codecs/wm5100.c | 3 +--
sound/soc/codecs/wm8903.c | 3 +--
sound/soc/codecs/wm8996.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 91a9ea2..7bb0d36 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -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;
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index b84940c..ec3250d 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -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;
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 6926633..9304a91 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -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;
--
1.8.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec()
2014-06-19 5:50 [PATCH] ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec() Lars-Peter Clausen
@ 2014-06-19 8:05 ` Charles Keepax
2014-06-19 9:56 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2014-06-19 8:05 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: alsa-devel, Mark Brown, Liam Girdwood, patches
On Thu, Jun 19, 2014 at 07:50:01AM +0200, Lars-Peter Clausen wrote:
> 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>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec()
2014-06-19 5:50 [PATCH] ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec() Lars-Peter Clausen
2014-06-19 8:05 ` Charles Keepax
@ 2014-06-19 9:56 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-06-19 9:56 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: Charles Keepax, patches, Liam Girdwood, alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 229 bytes --]
On Thu, Jun 19, 2014 at 07:50:01AM +0200, Lars-Peter Clausen wrote:
> 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.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-19 9:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 5:50 [PATCH] ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec() Lars-Peter Clausen
2014-06-19 8:05 ` Charles Keepax
2014-06-19 9:56 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.