From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: Mike Turquette <mturquette@linaro.org>,
Yadwinder Singh Brar <yadi.brar@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths
Date: Mon, 19 May 2014 08:52:42 +0200 [thread overview]
Message-ID: <1400482362.4382.0.camel@AMDC1943> (raw)
In-Reply-To: <1400428295.15403.3.camel@phoenix>
On nie, 2014-05-18 at 23:51 +0800, Axel Lin wrote:
> The devm_clk_unregister() in probe error paths are not necessary as it will be
> automatically called when probe fails.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/clk/clk-s2mps11.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Best regards,
Krzysztof
> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index f2f62a1b..aeaa61c 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -210,7 +210,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
> sizeof(struct clk_lookup), GFP_KERNEL);
> if (!s2mps11_clk->lookup) {
> ret = -ENOMEM;
> - goto err_lup;
> + goto err_reg;
> }
>
> s2mps11_clk->lookup->con_id = s2mps11_name(s2mps11_clk);
> @@ -231,16 +231,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, s2mps11_clks);
>
> return ret;
> -err_lup:
> - devm_clk_unregister(&pdev->dev, s2mps11_clk->clk);
> +
> err_reg:
> - while (s2mps11_clk > s2mps11_clks) {
> - if (s2mps11_clk->lookup) {
> - clkdev_drop(s2mps11_clk->lookup);
> - devm_clk_unregister(&pdev->dev, s2mps11_clk->clk);
> - }
> - s2mps11_clk--;
> - }
> + while (--i >= 0)
> + clkdev_drop(s2mps11_clks[i].lookup);
>
> return ret;
> }
prev parent reply other threads:[~2014-05-19 6:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 15:51 [PATCH] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths Axel Lin
2014-05-19 6:52 ` Krzysztof Kozlowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400482362.4382.0.camel@AMDC1943 \
--to=k.kozlowski@samsung.com \
--cc=axel.lin@ingics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=yadi.brar@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox