public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: cadence: Unregister the clk notifier in error path
@ 2022-06-28 19:12 Satish Nagireddy
  2022-06-28 19:13 ` Lars-Peter Clausen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Satish Nagireddy @ 2022-06-28 19:12 UTC (permalink / raw)
  To: wsa; +Cc: linux-i2c, linux-kernel, michal.simek, lars, Satish Nagireddy

This patch ensures that the clock notifier is unregistered
when driver probe is returning error.

Signed-off-by: Satish Nagireddy <satish.nagireddy@getcruise.com>
---
 drivers/i2c/busses/i2c-cadence.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index b4c1ad19cdae..3d6f8ee355bf 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -1338,6 +1338,7 @@ static int cdns_i2c_probe(struct platform_device *pdev)
 	return 0;
 
 err_clk_dis:
+	clk_notifier_unregister(id->clk, &id->clk_rate_change_nb);
 	clk_disable_unprepare(id->clk);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-- 
2.36.1


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

* Re: [PATCH] i2c: cadence: Unregister the clk notifier in error path
  2022-06-28 19:12 [PATCH] i2c: cadence: Unregister the clk notifier in error path Satish Nagireddy
@ 2022-06-28 19:13 ` Lars-Peter Clausen
  2022-07-07  8:14 ` Michal Simek
  2022-07-07 21:07 ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2022-06-28 19:13 UTC (permalink / raw)
  To: Satish Nagireddy, wsa; +Cc: linux-i2c, linux-kernel, michal.simek

On 6/28/22 21:12, Satish Nagireddy wrote:
> This patch ensures that the clock notifier is unregistered
> when driver probe is returning error.
>
> Signed-off-by: Satish Nagireddy <satish.nagireddy@getcruise.com>

Thanks! Looks good.

Tested-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
>   drivers/i2c/busses/i2c-cadence.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
> index b4c1ad19cdae..3d6f8ee355bf 100644
> --- a/drivers/i2c/busses/i2c-cadence.c
> +++ b/drivers/i2c/busses/i2c-cadence.c
> @@ -1338,6 +1338,7 @@ static int cdns_i2c_probe(struct platform_device *pdev)
>   	return 0;
>   
>   err_clk_dis:
> +	clk_notifier_unregister(id->clk, &id->clk_rate_change_nb);
>   	clk_disable_unprepare(id->clk);
>   	pm_runtime_disable(&pdev->dev);
>   	pm_runtime_set_suspended(&pdev->dev);



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

* Re: [PATCH] i2c: cadence: Unregister the clk notifier in error path
  2022-06-28 19:12 [PATCH] i2c: cadence: Unregister the clk notifier in error path Satish Nagireddy
  2022-06-28 19:13 ` Lars-Peter Clausen
@ 2022-07-07  8:14 ` Michal Simek
  2022-07-07 21:07 ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2022-07-07  8:14 UTC (permalink / raw)
  To: Satish Nagireddy, wsa; +Cc: linux-i2c, linux-kernel, michal.simek, lars



On 6/28/22 21:12, Satish Nagireddy wrote:
> This patch ensures that the clock notifier is unregistered
> when driver probe is returning error.
> 
> Signed-off-by: Satish Nagireddy <satish.nagireddy@getcruise.com>
> ---
>   drivers/i2c/busses/i2c-cadence.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
> index b4c1ad19cdae..3d6f8ee355bf 100644
> --- a/drivers/i2c/busses/i2c-cadence.c
> +++ b/drivers/i2c/busses/i2c-cadence.c
> @@ -1338,6 +1338,7 @@ static int cdns_i2c_probe(struct platform_device *pdev)
>          return 0;
> 
>   err_clk_dis:
> +       clk_notifier_unregister(id->clk, &id->clk_rate_change_nb);
>          clk_disable_unprepare(id->clk);
>          pm_runtime_disable(&pdev->dev);
>          pm_runtime_set_suspended(&pdev->dev);
> --
> 2.36.1
> 

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

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

* Re: [PATCH] i2c: cadence: Unregister the clk notifier in error path
  2022-06-28 19:12 [PATCH] i2c: cadence: Unregister the clk notifier in error path Satish Nagireddy
  2022-06-28 19:13 ` Lars-Peter Clausen
  2022-07-07  8:14 ` Michal Simek
@ 2022-07-07 21:07 ` Wolfram Sang
  2022-07-07 23:17   ` [EXT] " Satish Nagireddy
  2 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2022-07-07 21:07 UTC (permalink / raw)
  To: Satish Nagireddy; +Cc: linux-i2c, linux-kernel, michal.simek, lars

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Tue, Jun 28, 2022 at 12:12:16PM -0700, Satish Nagireddy wrote:
> This patch ensures that the clock notifier is unregistered
> when driver probe is returning error.
> 
> Signed-off-by: Satish Nagireddy <satish.nagireddy@getcruise.com>

Applied to for-current, thanks! I added a Fixes: tag. It would be great
if you had the time to provide it next time with the patch.

Happy hacking!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [EXT] Re: [PATCH] i2c: cadence: Unregister the clk notifier in error path
  2022-07-07 21:07 ` Wolfram Sang
@ 2022-07-07 23:17   ` Satish Nagireddy
  0 siblings, 0 replies; 5+ messages in thread
From: Satish Nagireddy @ 2022-07-07 23:17 UTC (permalink / raw)
  To: Wolfram Sang, Satish Nagireddy, linux-i2c, linux-kernel,
	michal.simek, lars

On Thu, Jul 7, 2022 at 2:08 PM Wolfram Sang <wsa@kernel.org> wrote:
>
> On Tue, Jun 28, 2022 at 12:12:16PM -0700, Satish Nagireddy wrote:
> > This patch ensures that the clock notifier is unregistered
> > when driver probe is returning error.
> >
> > Signed-off-by: Satish Nagireddy <satish.nagireddy@getcruise.com>
>
> Applied to for-current, thanks! I added a Fixes: tag. It would be great
> if you had the time to provide it next time with the patch.
>
> Happy hacking!
>

Sure, thank you!

Regards,
Satish

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

end of thread, other threads:[~2022-07-07 23:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-28 19:12 [PATCH] i2c: cadence: Unregister the clk notifier in error path Satish Nagireddy
2022-06-28 19:13 ` Lars-Peter Clausen
2022-07-07  8:14 ` Michal Simek
2022-07-07 21:07 ` Wolfram Sang
2022-07-07 23:17   ` [EXT] " Satish Nagireddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox