lkml.org 
[lkml]   [2020]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 2/2] ASoC: qcom: sc7180: Modify machine driver for 2mic
On Mon, Nov 2, 2020 at 2:24 PM Ajye Huang <ajye.huang@gmail.com> wrote:
>
> In addition, having mixer control to switch between DMICs by
> using "dmic-gpios" property.
>
> Refer to this one as an example,
> commit b7a742cff3f6 ("ASoC: AMD: Use mixer control to switch between DMICs")
>
> Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>

I am not sure if it would be better if you use another email (e.g.
@gmail) for signoff.

> +static int dmic_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
> + struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card);
> +
> + if (data)

You don't need to check for NULL. If snd_soc_card_get_drvdata()
returns NULL, it shouldn't run into here. See other
snd_soc_card_get_drvdata() calls in the file.

> +static int dmic_set(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol);
> + struct sc7180_snd_data *data = snd_soc_card_get_drvdata(dapm->card);
> +
> + if (data) {

Ditto.

> + if (IS_ERR(data->dmic_sel)) {
> + dev_err(&pdev->dev, "DMIC gpio failed err=%d\n",
> + PTR_ERR(data->dmic_sel));
> + return PTR_ERR(data->dmic_sel);

Remove 1 level indent.

\
 
 \ /
  Last update: 2020-11-02 11:47    [W:0.447 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site