From: Chanwoo Choi <cw00.choi@samsung.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>,
s.nawrocki@samsung.com, tomasz.figa@gmail.com,
alim.akhtar@samsung.com, mturquette@baylibre.com,
sboyd@kernel.org, krzysztof.kozlowski@linaro.org
Cc: linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: samsung: Add check for platform_driver_register
Date: Fri, 27 May 2022 18:09:23 +0900 [thread overview]
Message-ID: <377a917b-96b1-14ff-ee57-f841e12c3b41@samsung.com> (raw)
In-Reply-To: <20220526101215.1519155-1-jiasheng@iscas.ac.cn>
On 5/26/22 7:12 PM, Jiasheng Jiang wrote:
> As platform_driver_register() could fail, it should be better
> to deal with the return value in order to maintain the code
> consisitency.
>
> Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> drivers/clk/samsung/clk-exynos5-subcmu.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c
> index 65c82d922b05..8b090481a9dc 100644
> --- a/drivers/clk/samsung/clk-exynos5-subcmu.c
> +++ b/drivers/clk/samsung/clk-exynos5-subcmu.c
> @@ -188,8 +188,18 @@ static struct platform_driver exynos5_clk_driver __refdata = {
>
> static int __init exynos5_clk_drv_init(void)
> {
> - platform_driver_register(&exynos5_clk_driver);
> - platform_driver_register(&exynos5_subcmu_driver);
> + int ret;
> +
> + ret = platform_driver_register(&exynos5_clk_driver);
> + if (ret)
> + return ret;
> +
> + ret = platform_driver_register(&exynos5_subcmu_driver);
> + if (ret) {
> + platform_driver_unregister(&exynos5_clk_driver);
> + return ret;
> + }
> +
> return 0;
> }
> core_initcall(exynos5_clk_drv_init);
>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Thanks.
--
Best Regards,
Chanwoo Choi
Samsung Electronics
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>,
s.nawrocki@samsung.com, tomasz.figa@gmail.com,
alim.akhtar@samsung.com, mturquette@baylibre.com,
sboyd@kernel.org, krzysztof.kozlowski@linaro.org
Cc: linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: samsung: Add check for platform_driver_register
Date: Fri, 27 May 2022 18:09:23 +0900 [thread overview]
Message-ID: <377a917b-96b1-14ff-ee57-f841e12c3b41@samsung.com> (raw)
In-Reply-To: <20220526101215.1519155-1-jiasheng@iscas.ac.cn>
On 5/26/22 7:12 PM, Jiasheng Jiang wrote:
> As platform_driver_register() could fail, it should be better
> to deal with the return value in order to maintain the code
> consisitency.
>
> Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> drivers/clk/samsung/clk-exynos5-subcmu.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-exynos5-subcmu.c b/drivers/clk/samsung/clk-exynos5-subcmu.c
> index 65c82d922b05..8b090481a9dc 100644
> --- a/drivers/clk/samsung/clk-exynos5-subcmu.c
> +++ b/drivers/clk/samsung/clk-exynos5-subcmu.c
> @@ -188,8 +188,18 @@ static struct platform_driver exynos5_clk_driver __refdata = {
>
> static int __init exynos5_clk_drv_init(void)
> {
> - platform_driver_register(&exynos5_clk_driver);
> - platform_driver_register(&exynos5_subcmu_driver);
> + int ret;
> +
> + ret = platform_driver_register(&exynos5_clk_driver);
> + if (ret)
> + return ret;
> +
> + ret = platform_driver_register(&exynos5_subcmu_driver);
> + if (ret) {
> + platform_driver_unregister(&exynos5_clk_driver);
> + return ret;
> + }
> +
> return 0;
> }
> core_initcall(exynos5_clk_drv_init);
>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Thanks.
--
Best Regards,
Chanwoo Choi
Samsung Electronics
next prev parent reply other threads:[~2022-05-27 9:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220526101239epcas1p33aec5e8e0386d6b986ffb16bc3f68bab@epcas1p3.samsung.com>
2022-05-26 10:12 ` [PATCH] clk: samsung: Add check for platform_driver_register Jiasheng Jiang
2022-05-26 10:12 ` Jiasheng Jiang
2022-05-27 9:09 ` Chanwoo Choi [this message]
2022-05-27 9:09 ` Chanwoo Choi
2022-06-16 0:07 ` Stephen Boyd
2022-06-16 0:07 ` Stephen Boyd
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=377a917b-96b1-14ff-ee57-f841e12c3b41@samsung.com \
--to=cw00.choi@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=jiasheng@iscas.ac.cn \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=s.nawrocki@samsung.com \
--cc=sboyd@kernel.org \
--cc=tomasz.figa@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.