lkml.org 
[lkml]   [2020]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 2/2] ASoC: qcom: sc7180: Modify machine driver for 2mic
On Fri, Oct 30, 2020 at 3:57 PM Ajye Huang <ajye.huang@gmail.com> wrote:
> +static struct gpio_desc *dmic_sel;
> +static int dmic_switch;

If you really need them, you should put them in struct sc7180_snd_data.

> +static int dmic_set(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + if (dmic_sel) {

if (IS_ERR(dmic_sel))
But I think you don't need to check dmic_sel. Suppose your _probe()
already returned error, the code here shouldn't be called.

> + dmic_switch = ucontrol->value.integer.value[0];

Looks like it can be a local variable. You don't need to save dmic_switch.

\
 
 \ /
  Last update: 2020-10-30 10:23    [W:1.177 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site