From patchwork Fri Nov 4 14:45:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 9412707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5498D60722 for ; Fri, 4 Nov 2016 14:48:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 466AF2B1A5 for ; Fri, 4 Nov 2016 14:48:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B1ED2B1A9; Fri, 4 Nov 2016 14:48:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 730672B1A5 for ; Fri, 4 Nov 2016 14:48:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 91BE82665A6; Fri, 4 Nov 2016 15:48:17 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6A26F266623; Fri, 4 Nov 2016 15:45:59 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BBF90266B2C; Fri, 4 Nov 2016 15:45:49 +0100 (CET) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by alsa0.perex.cz (Postfix) with ESMTP id 9ABBA266623 for ; Fri, 4 Nov 2016 15:45:44 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id p190so55704286wmp.1 for ; Fri, 04 Nov 2016 07:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=o7nZIxlpiZ6+YG6BZOb4743pYXCtT6xxvqkLvx5jqfc=; b=HMX98PDY9GYmjI1Cqfkwc+gUaovZGWr0PILggZd+Stj2S6x0TUNisHb9JdBKRGhe1J GJwHaiVbsMHDxS5M1jMmAVb1oI59sKaZ4VbBVNFkiX0ZOd6s4TeSaj380KrrkUH+mhRJ 92aoLXgeZs+SBQ6f8zVpMmbHewcjjrXybFYug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o7nZIxlpiZ6+YG6BZOb4743pYXCtT6xxvqkLvx5jqfc=; b=aSsw7mmhZMy+4I7ScGShLpbmpvwFUH04sm7zE3dsbj70JesNdc/XJpGWb4r+KjFiiu dgvSvBBPblWvc7aR9fVcMqi09BuQD0se9e7Q9c5VQPFBFGrHG5fTtRnRa781iYpd7rXA uAFZJUuVrzLVqglMyhbWRJ4oYLqkW1My4N3vzxOlSaxppuHG13K8RPZKAZ0gU1QXAl7U A+co9ZLs84AHwyf/rXiL3Z4ZcCtOdXzk3HzcFnk3u5uMNZedvSlJ9s0LATtm3UkJcPqQ O7jC6ubbMQuV6neKj7tYaoLd1J1cfhs76Jq/hOsa2mc9QDQTFOPtRxz95JB1aygc9wfu se5Q== X-Gm-Message-State: ABUngvcE+rWAbCVN6XTiEDzs3HpgNUTqYNu+5NZBgiJQW8bq9RWYGrtkkGDxR9Jh0I3x1wRq X-Received: by 10.194.122.67 with SMTP id lq3mr15510725wjb.54.1478270743860; Fri, 04 Nov 2016 07:45:43 -0700 (PDT) Received: from localhost.localdomain (host-2-98-102-117.as13285.net. [2.98.102.117]) by smtp.gmail.com with ESMTPSA id i15sm463523wjs.16.2016.11.04.07.45.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Nov 2016 07:45:43 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org Date: Fri, 4 Nov 2016 14:45:39 +0000 Message-Id: <1478270740-3037-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: linux-arm-msm@vger.kernel.org, kwestfie@codeaurora.org, srinivas.kandagatla@linaro.org, tiwai@suse.com Subject: [alsa-devel] [PATCH 1/2] ASoC: codecs: msm8916-wcd-analog: clean parse_dt() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Move the code which is not parsing dt from pm8916_wcd_analog_parse_dt() to make it clear to reader. No functional changes done. Signed-off-by: Srinivas Kandagatla --- This change was suggested by Mark http://www.spinics.net/lists/alsa-devel/msg55878.html thanks, srini sound/soc/codecs/msm8916-wcd-analog.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) -- 2.10.1 diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index d9f999b..50ad75a 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -802,7 +802,6 @@ static struct snd_soc_codec_driver pm8916_wcd_analog = { static int pm8916_wcd_analog_parse_dt(struct device *dev, struct pm8916_wcd_analog_priv *priv) { - int ret, i; if (of_property_read_bool(dev->of_node, "qcom,micbias1-ext-cap")) priv->micbias1_cap_mode = MICB_1_EN_EXT_BYP_CAP; @@ -814,21 +813,6 @@ static int pm8916_wcd_analog_parse_dt(struct device *dev, else priv->micbias2_cap_mode = MICB_1_EN_NO_EXT_BYP_CAP; - priv->mclk = devm_clk_get(dev, "mclk"); - if (IS_ERR(priv->mclk)) { - dev_err(dev, "failed to get mclk\n"); - return PTR_ERR(priv->mclk); - } - for (i = 0; i < ARRAY_SIZE(supply_names); i++) - priv->supplies[i].supply = supply_names[i]; - - ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies), - priv->supplies); - if (ret) { - dev_err(dev, "Failed to get regulator supplies %d\n", ret); - return ret; - } - return 0; } @@ -836,7 +820,7 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) { struct pm8916_wcd_analog_priv *priv; struct device *dev = &pdev->dev; - int ret; + int ret, i; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -846,6 +830,22 @@ static int pm8916_wcd_analog_spmi_probe(struct platform_device *pdev) if (ret < 0) return ret; + priv->mclk = devm_clk_get(dev, "mclk"); + if (IS_ERR(priv->mclk)) { + dev_err(dev, "failed to get mclk\n"); + return PTR_ERR(priv->mclk); + } + + for (i = 0; i < ARRAY_SIZE(supply_names); i++) + priv->supplies[i].supply = supply_names[i]; + + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(priv->supplies), + priv->supplies); + if (ret) { + dev_err(dev, "Failed to get regulator supplies %d\n", ret); + return ret; + } + ret = clk_prepare_enable(priv->mclk); if (ret < 0) { dev_err(dev, "failed to enable mclk %d\n", ret);