Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp272024pxx; Thu, 29 Oct 2020 02:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2UyvQFWkfMwqKcrgOcnXrjc2/WHv+eIRrpay9ZOgOY+qLCMQZRRNttbOiqnwQcgZ3duPy X-Received: by 2002:a17:906:34ce:: with SMTP id h14mr2975484ejb.325.1603962522618; Thu, 29 Oct 2020 02:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603962522; cv=none; d=google.com; s=arc-20160816; b=0aX4QlkQQhEjdnimc32jTXpwJJMFX3DBzTgGrNEqOk56Vcm+3cDiYQBHIab0FytNYI 5+8G+3XqkCOyhgjGSyb1SeamC4I1C6J1LYaA32UcljrS7ZJPdf8I8bqN19t/LMWMAJYf 57wYHv/7pADQCeHHFLQRya1NwOA+YZRjfFk1rYDIB/9d2VQeoA8hws4cU2lSecEbvt61 P7I0hwOpTN1yximHbNbhWG9gbDQoC/Ye1ml8ajHRr7IL3X5CCSChg+as9gYD3XFwLA4o Dpd5UttE2QI2ZzwMo728DZox9xYXNufWBRS8NjPnxD+WB+mL4Gb6tDx/ooM1iKQCLEUn FE1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=CUvnuWSKi9PCx3N72+GuDLIdwCG/3Z4EmE/ayIx4xow=; b=SShNCvUcFnqc9XWxGHo8KOweQQqbBWhoYWvSPLR2ONlaYdZbuuX8svPHAsTqvd7tBS 4/dzxygW4Lo7U3FAfIRCe/1r3kPHDmwGn9XvKx34RC/axaJh5dnF9KEDjOKHlDKhzjmY G8Sxy1dRmvmoHAhMYmlOhnPX7JZdDBa7HALQyPFXIgnaOGuSgmjv9vw8f+IWGzMfmYAk vBNqX+iyjaAAzug6KEdy0UQUsm7N0xb3AYBmpejLIBLRUSlrB30DI4LBqpGgFTYlAmaG DKvEryEU4HnZWT5tgrkADz1Uy/iMzOlKDLqNsTMaS7CaLw5HgtfTyhKVMIlXV18TEyAd xxPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="VuFzfH/X"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy27si1565354edb.52.2020.10.29.02.08.19; Thu, 29 Oct 2020 02:08:42 -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=@mg.codeaurora.org header.s=smtp header.b="VuFzfH/X"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726128AbgJ2JDT (ORCPT + 99 others); Thu, 29 Oct 2020 05:03:19 -0400 Received: from z5.mailgun.us ([104.130.96.5]:54241 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgJ2JDE (ORCPT ); Thu, 29 Oct 2020 05:03:04 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1603962183; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=CUvnuWSKi9PCx3N72+GuDLIdwCG/3Z4EmE/ayIx4xow=; b=VuFzfH/XoVZBQuVJUDg+SIaMraGVsBjycCKFr05h2+8G62bXnjcrenuYCX8ojZQbRFqLagh4 6lpggLWoir+zWihNSCpVzcnJwPqNNM2MrSrLeeqddvdAAMR5ZPGRddyp9ZzIn+CKK/4JXh2S 47RP7yZP62Mwwb6bE0TkwS45WD4= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 5f9a851f940cfd47f1488953 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 29 Oct 2020 09:02:23 GMT Sender: tdas=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AFAD2C4339C; Thu, 29 Oct 2020 09:02:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.106] (unknown [49.204.180.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tdas) by smtp.codeaurora.org (Postfix) with ESMTPSA id 56DD3C433FF; Thu, 29 Oct 2020 09:02:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 56DD3C433FF Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=tdas@codeaurora.org Subject: Re: [PATCH v5 1/2] clk: qcom: lpasscc-sc7810: Use devm in probe To: Douglas Anderson , Stephen Boyd Cc: David Brown , Rajendra Nayak , linux-soc@vger.kernel.org, Andy Gross , Bjorn Andersson , Michael Turquette , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201019154857.v5.1.I4567b5e7e17bbb15ef063d447cb83fd43746cb18@changeid> From: Taniya Das Message-ID: <669a0546-f6d9-6b68-207f-eb75832041fa@codeaurora.org> Date: Thu, 29 Oct 2020 14:32:16 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <20201019154857.v5.1.I4567b5e7e17bbb15ef063d447cb83fd43746cb18@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Taniya Das On 10/20/2020 4:19 AM, Douglas Anderson wrote: > Let's convert the lpass clock control driver to use devm. This is a > few more lines of code, but it will be useful in a later patch which > disentangles the two devices handled by this driver. > > Signed-off-by: Douglas Anderson > --- > > (no changes since v4) > > Changes in v4: > - Fixed typo lapss => lpass > - Moved lpass_pm_runtime_disable() lpass_pm_clk_destroy() in file. > > Changes in v3: > - ("clk: qcom: lpasscc-sc7810: Use devm in probe") new for v3. > > drivers/clk/qcom/lpasscorecc-sc7180.c | 38 +++++++++++++++------------ > 1 file changed, 21 insertions(+), 17 deletions(-) > > diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c > index 228d08f5d26f..2d15e33ec837 100644 > --- a/drivers/clk/qcom/lpasscorecc-sc7180.c > +++ b/drivers/clk/qcom/lpasscorecc-sc7180.c > @@ -356,6 +356,16 @@ static const struct qcom_cc_desc lpass_audio_hm_sc7180_desc = { > .num_gdscs = ARRAY_SIZE(lpass_audio_hm_sc7180_gdscs), > }; > > +static void lpass_pm_runtime_disable(void *data) > +{ > + pm_runtime_disable(data); > +} > + > +static void lpass_pm_clk_destroy(void *data) > +{ > + pm_clk_destroy(data); > +} > + > static int lpass_core_cc_sc7180_probe(struct platform_device *pdev) > { > const struct qcom_cc_desc *desc; > @@ -418,34 +428,28 @@ static int lpass_core_sc7180_probe(struct platform_device *pdev) > int ret; > > pm_runtime_enable(&pdev->dev); > + ret = devm_add_action_or_reset(&pdev->dev, lpass_pm_runtime_disable, &pdev->dev); > + if (ret) > + return ret; > + > ret = pm_clk_create(&pdev->dev); > if (ret) > - goto disable_pm_runtime; > + return ret; > + ret = devm_add_action_or_reset(&pdev->dev, lpass_pm_clk_destroy, &pdev->dev); > + if (ret) > + return ret; > > ret = pm_clk_add(&pdev->dev, "iface"); > if (ret < 0) { > dev_err(&pdev->dev, "failed to acquire iface clock\n"); > - goto destroy_pm_clk; > + return ret; > } > > - ret = -EINVAL; > clk_probe = of_device_get_match_data(&pdev->dev); > if (!clk_probe) > - goto destroy_pm_clk; > - > - ret = clk_probe(pdev); > - if (ret) > - goto destroy_pm_clk; > - > - return 0; > - > -destroy_pm_clk: > - pm_clk_destroy(&pdev->dev); > - > -disable_pm_runtime: > - pm_runtime_disable(&pdev->dev); > + return -EINVAL; > > - return ret; > + return clk_probe(pdev); > } > > static const struct dev_pm_ops lpass_core_cc_pm_ops = { > -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation. --