Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1116104pxx; Fri, 30 Oct 2020 02:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6ABkIGCsoxo/Hgidvy/Mrz+uyx42CuiK1tXlzOGyvQMmwvorfYAXAsxX27OsZUpfDcA6Q X-Received: by 2002:a50:eb0a:: with SMTP id y10mr1315715edp.342.1604049929938; Fri, 30 Oct 2020 02:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604049929; cv=none; d=google.com; s=arc-20160816; b=ILg85uxvfMLphCjjBc+lGHCiaI406jEsmdfyClRCH2bTRWublCiudmUY8fMiItv1iW FqWGbZN91Dfu5kI4zU9GM12DpajAtCK7tyz/Bwe99GdcPAiL/6MHkJJpXIsBsUgbSVp5 LcG4dRLbUb6f9Qqtgv8iDCeapfvW15R0T+ypheuLyNzZ+Z8ZZdkUBn5hgZV2zG0Fbu0+ oGpnPwWsS6E/9yns0fRN8rCRVRG3axL6DRt8E0Kz3hpshN0nXkJNZozUkHpyoCgsPSnv BWmE8OziXEPAEUt4led2xLqiVe2p37eYUzqTHRq+NgFeWPTe/eUpeeJUHJZDht0az5xw M6VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CBA+zo6LaSoFeL0OA7IbUTdbUJNI/GOykxoTxkhm2nk=; b=IvDunQuUUxacW/WqVVau/ngPswFpIBUsAswY3PV/C/G2XX3HugXvoj8vgPUnkY3wZ0 FXoYb4kn4xIZXMloOZnzumB+3vbKFqAIYf4i6y2cAZMxU9fETHxagkTX3L7/i8UEvC9k DtJaaaKEV4r3O/AOnCnQB36MqcUsnblzAAyXMTa5zQ6CRunT+6LrkYcz9fgwNdOl4nzx VC0BgqX5HrY4X50KnfhRrer6zu3NItIDHI1xDByO/ysd42n+EII785d4t4QCofkKapm3 QIfVVmixu24xQI9wWVI6YndeBTltloGkQwQ2bZczELnld7+f4fjDo5oz+JruJBdkuAgT jl2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UO5IfL8R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si3651180ejk.598.2020.10.30.02.25.07; Fri, 30 Oct 2020 02:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UO5IfL8R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725888AbgJ3JXW (ORCPT + 99 others); Fri, 30 Oct 2020 05:23:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgJ3JXW (ORCPT ); Fri, 30 Oct 2020 05:23:22 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 355DBC0613CF for ; Fri, 30 Oct 2020 02:23:22 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id z5so6820206iob.1 for ; Fri, 30 Oct 2020 02:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CBA+zo6LaSoFeL0OA7IbUTdbUJNI/GOykxoTxkhm2nk=; b=UO5IfL8R5QFcwjro3zMCatag08rvnj7MG+rIfVf8CZY1PLx4Z0SoVQtu3DvG/0uf2N YIRVCW8AOfZZVXKBcMTqoLCPZMQ5Kdr+w2h4Jyf/fzhu6jZud64aAlrfyOQbqcC7FZig 6RxtRmtJurOtE9CKuMpk1+tU/vGvKGRNHkDxmw8yP7WTwOpd+GVyHY20Brqmw6oBEwuq QvZM45AWJDmHUwcapmaYrBa+pQ32oebVFliheC058EYqeCLz6IBmN6i+RIW2LIsORGah PPcv4Mf1Xo6nq/dRGbcCEpsqtymMwkMc30l3lLgjDsRtVNql2yXNOini1QEbK9TJHv/h xoFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CBA+zo6LaSoFeL0OA7IbUTdbUJNI/GOykxoTxkhm2nk=; b=UBZZLBitGw5QHXzvA/SJG8+6vnXW7XEOEJRzB7ZYt9hFtzF4ihusAk8Rr7pP10BXh+ 4HfrMh2Q9rRnzm6ElapXEqkyc5mGiI80UpASckK0F3sqi8Bn+mFsuq38oKwleGzaUWun G08F6B/mkD3Mw0+njXfp7Ean6xP0JWSCXEp1NE4IiaClty4/4NvGoHH+Y1b9/ZhfYHmI vfqeQOCxgiLkRuBYvZQPNiqw9e+ZnY5XqqbzvXFzLQQHgN6JNJXESmPP28QFGKCafv2O Vn9iLs83YrbEoxDOKwa313l1OH2PfyCPLtIIlD3CILMYSXpKLnjKowlKWwpYK4YtChpX OC+w== X-Gm-Message-State: AOAM530Hu1bFYe6fWhXCVLTfVtRxA2jcJT2qA0qiK6oMne4CenB4SzwI wvQIzE6OsxuiXqHyHpu7ov5hc6cKI5cxWvvOZdb0Ow== X-Received: by 2002:a6b:c8c1:: with SMTP id y184mr1050821iof.109.1604049801372; Fri, 30 Oct 2020 02:23:21 -0700 (PDT) MIME-Version: 1.0 References: <20201030075724.1616766-1-ajye_huang@compal.corp-partner.google.com> <20201030075724.1616766-3-ajye_huang@compal.corp-partner.google.com> In-Reply-To: <20201030075724.1616766-3-ajye_huang@compal.corp-partner.google.com> From: Tzung-Bi Shih Date: Fri, 30 Oct 2020 17:23:10 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] ASoC: qcom: sc7180: Modify machine driver for 2mic To: Ajye Huang Cc: Linux Kernel Mailing List , Mark Brown , Rohit kumar , Banajit Goswami , Patrick Lai , Srinivasa Rao Mandadapu , Srini Kandagatla , Andy Gross , Bjorn Andersson , Liam Girdwood , Rob Herring , Jaroslav Kysela , Cheng-Yi Chiang , Tzung-Bi Shih , Douglas Anderson , "moderated list:ARM/Mediatek SoC support" , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , ALSA development , Ajye Huang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 30, 2020 at 3:57 PM Ajye Huang 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.