From: Stephen Boyd <sboyd@kernel.org>
To: "Alim Akhtar" <alim.akhtar@samsung.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Michael Turquette" <mturquette@baylibre.com>,
"Rob Herring" <robh@kernel.org>,
"Russell King" <linux@armlinux.org.uk>
Cc: kernel@collabora.com, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org,
linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH v3 1/4] clk: Provide devm_clk_bulk_get_all_enabled() helper
Date: Fri, 18 Oct 2024 22:56:28 -0700 [thread overview]
Message-ID: <c0afdf9f8c9773ef83274cb119d14c90.sboyd@kernel.org> (raw)
In-Reply-To: <20241018-clk_bulk_ena_fix-v3-1-57e8bb82460c@collabora.com>
Quoting Cristian Ciocaltea (2024-10-17 16:17:29)
> diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c
> index 82ae1f26e634572b943d18b8d86267f0a69911a6..0d0fe364b66a8590d5e7c63dc6c1e70c59d53e89 100644
> --- a/drivers/clk/clk-devres.c
> +++ b/drivers/clk/clk-devres.c
> @@ -230,25 +239,27 @@ int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
> return -ENOMEM;
>
> ret = clk_bulk_get_all(dev, &devres->clks);
> - if (ret > 0) {
> - *clks = devres->clks;
> - devres->num_clks = ret;
> - } else {
> - devres_free(devres);
> - return ret;
> - }
> + if (ret <= 0)
> + goto err_free_devres;
Please don't use goto so that the diff is minimized.
> +
> + *clks = devres->clks;
> + devres->num_clks = ret;
>
> ret = clk_bulk_prepare_enable(devres->num_clks, *clks);
> - if (!ret) {
> - devres_add(dev, devres);
> - } else {
> + if (ret) {
> clk_bulk_put_all(devres->num_clks, devres->clks);
> - devres_free(devres);
> + goto err_free_devres;
return ret;
next prev parent reply other threads:[~2024-10-19 5:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 23:17 [PATCH v3 0/4] Provide devm_clk_bulk_get_all_enabled() helper Cristian Ciocaltea
2024-10-17 23:17 ` [PATCH v3 1/4] clk: " Cristian Ciocaltea
2024-10-19 5:56 ` Stephen Boyd [this message]
2024-10-19 11:20 ` Cristian Ciocaltea
2024-10-17 23:17 ` [PATCH v3 2/4] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled() Cristian Ciocaltea
2024-10-17 23:17 ` [PATCH v3 3/4] PCI: exynos: " Cristian Ciocaltea
2024-10-17 23:17 ` [PATCH v3 4/4] clk: Drop obsolete devm_clk_bulk_get_all_enable() helper Cristian Ciocaltea
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=c0afdf9f8c9773ef83274cb119d14c90.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bhelgaas@google.com \
--cc=cristian.ciocaltea@collabora.com \
--cc=jingoohan1@gmail.com \
--cc=kernel@collabora.com \
--cc=krzk@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=matthias.bgg@gmail.com \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
/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