All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: samsung: Add check for platform_driver_register
@ 2022-05-26 10:12   ` Jiasheng Jiang
  0 siblings, 0 replies; 6+ messages in thread
From: Jiasheng Jiang @ 2022-05-26 10:12 UTC (permalink / raw)
  To: s.nawrocki, tomasz.figa, cw00.choi, alim.akhtar, mturquette,
	sboyd, krzysztof.kozlowski
  Cc: linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel,
	Jiasheng Jiang

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);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] clk: samsung: Add check for platform_driver_register
@ 2022-05-26 10:12   ` Jiasheng Jiang
  0 siblings, 0 replies; 6+ messages in thread
From: Jiasheng Jiang @ 2022-05-26 10:12 UTC (permalink / raw)
  To: s.nawrocki, tomasz.figa, cw00.choi, alim.akhtar, mturquette,
	sboyd, krzysztof.kozlowski
  Cc: linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel,
	Jiasheng Jiang

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);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: samsung: Add check for platform_driver_register
  2022-05-26 10:12   ` Jiasheng Jiang
@ 2022-05-27  9:09     ` Chanwoo Choi
  -1 siblings, 0 replies; 6+ messages in thread
From: Chanwoo Choi @ 2022-05-27  9:09 UTC (permalink / raw)
  To: Jiasheng Jiang, s.nawrocki, tomasz.figa, alim.akhtar, mturquette,
	sboyd, krzysztof.kozlowski
  Cc: linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: samsung: Add check for platform_driver_register
@ 2022-05-27  9:09     ` Chanwoo Choi
  0 siblings, 0 replies; 6+ messages in thread
From: Chanwoo Choi @ 2022-05-27  9:09 UTC (permalink / raw)
  To: Jiasheng Jiang, s.nawrocki, tomasz.figa, alim.akhtar, mturquette,
	sboyd, krzysztof.kozlowski
  Cc: linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: samsung: Add check for platform_driver_register
  2022-05-26 10:12   ` Jiasheng Jiang
@ 2022-06-16  0:07     ` Stephen Boyd
  -1 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2022-06-16  0:07 UTC (permalink / raw)
  To: Jiasheng Jiang, alim.akhtar, cw00.choi, krzysztof.kozlowski,
	mturquette, s.nawrocki, tomasz.figa
  Cc: linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel,
	Jiasheng Jiang

Quoting Jiasheng Jiang (2022-05-26 03:12:15)
> 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>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: samsung: Add check for platform_driver_register
@ 2022-06-16  0:07     ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2022-06-16  0:07 UTC (permalink / raw)
  To: Jiasheng Jiang, alim.akhtar, cw00.choi, krzysztof.kozlowski,
	mturquette, s.nawrocki, tomasz.figa
  Cc: linux-samsung-soc, linux-clk, linux-arm-kernel, linux-kernel,
	Jiasheng Jiang

Quoting Jiasheng Jiang (2022-05-26 03:12:15)
> 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>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-16  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
2022-05-27  9:09     ` Chanwoo Choi
2022-06-16  0:07   ` Stephen Boyd
2022-06-16  0:07     ` Stephen Boyd

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.