Re: [PATCH v2 4/6] staging: greybus: audio: Resolve compilation error in topology parser
From: Dan Carpenter
Date: Wed Jun 10 2020 - 13:46:51 EST
On Wed, Jun 10, 2020 at 10:58:28PM +0530, Vaibhav Agarwal wrote:
> @@ -437,11 +433,12 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol,
> struct gbaudio_module_info *module;
> struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
> struct snd_soc_dapm_widget *widget = wlist->widgets[0];
> - struct snd_soc_codec *codec = widget->codec;
> - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec);
> + struct device *codec_dev = widget->dapm->dev;
> + struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev);
> + struct snd_soc_dapm_update *update = NULL;
^^^^^^^^^^^^^
> struct gb_bundle *bundle;
>
> - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
> + dev_dbg(codec_dev, "Entered %s:%s\n", __func__, kcontrol->id.name);
> module = find_gb_module(gb, kcontrol->id.name);
> if (!module)
> return -EINVAL;
> @@ -458,17 +455,13 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol,
> max = le32_to_cpu(info->value.integer.max);
> mask = (1 << fls(max)) - 1;
> val = ucontrol->value.integer.value[0] & mask;
> - connect = !!val;
>
> /* update ucontrol */
> if (gbvalue.value.integer_value[0] != val) {
> for (wi = 0; wi < wlist->num_widgets; wi++) {
> widget = wlist->widgets[wi];
> -
> - widget->value = val;
> - widget->dapm->update = NULL;
> - snd_soc_dapm_mixer_update_power(widget, kcontrol,
> - connect);
> + snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol,
> + val, update);
^^^^^^
Always NULL. Just delete the update variable.
regards,
dan carpenter