Message ID | 20141110114518.715dcd4e@notabene.brown (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 11/10/2014 01:45 AM, NeilBrown wrote: > diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c > index b6b0cb399599..613b61cee081 100644 > --- a/sound/soc/codecs/twl4030.c > +++ b/sound/soc/codecs/twl4030.c > @@ -957,6 +957,16 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol, > { > struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); > struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); > + struct snd_ctl_elem_value currentval; > snd_ctl_elem_value is a bit to big to be put onto the kernel stack. Just using twl4030_read() should be fine.
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index b6b0cb399599..613b61cee081 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -957,6 +957,16 @@ static int snd_soc_put_twl4030_opmode_enum_double(struct snd_kcontrol *kcontrol, { struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); + struct snd_ctl_elem_value currentval; + int ret; + + ret = snd_soc_get_enum_double(kcontrol, ¤tval); + if (ret) + return ret; + if (ucontrol->value.enumerated.item[0] == + currentval.value.enumerated.item[0]) + /* No change */ + return 0; if (twl4030->configured) { dev_err(codec->dev,