[PATCH] i2c: i2c-rzv2m: fix runtime PM cleanup

Jiawen Liu posted 1 patch 1 month, 1 week ago
[PATCH] i2c: i2c-rzv2m: fix runtime PM cleanup
Posted by Jiawen Liu 1 month, 1 week ago
Update rzv2m_i2c_probe() for the confirmed driver lifecycle defect.

Keep the change limited to the concrete operation shown in the final
patch.

Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-rzv2m.c
--- a/drivers/i2c/busses/i2c-rzv2m.c
+++ b/drivers/i2c/busses/i2c-rzv2m.c
@@ -461,7 +461,12 @@
 
 	pm_runtime_enable(dev);
 
-	pm_runtime_get_sync(dev);
+	ret = pm_runtime_get_sync(dev);
+	if (ret < 0) {
+		pm_runtime_put_noidle(dev);
+		return ret;
+	}
+
 	rzv2m_i2c_init(priv);
 	pm_runtime_put(dev);
Re: [PATCH] i2c: i2c-rzv2m: fix runtime PM cleanup
Posted by Geert Uytterhoeven 1 month, 1 week ago
Hi Jiawen,

Thanks for your patch!

On Tue, 18 Aug 2026 at 15:21, Jiawen Liu <1298662399@qq.com> wrote:
> Update rzv2m_i2c_probe() for the confirmed driver lifecycle defect.
>
> Keep the change limited to the concrete operation shown in the final
> patch.

Please write a better patch description.

> Signed-off-by: jiawen <1298662399@qq.com>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH] i2c: i2c-rzv2m: fix runtime PM cleanup
Posted by Andi Shyti 1 month, 1 week ago
Hi Jiawen,

On Tue, Aug 18, 2026 at 05:15:01PM +0400, Jiawen Liu wrote:
> Update rzv2m_i2c_probe() for the confirmed driver lifecycle defect.
> 
> Keep the change limited to the concrete operation shown in the final
> patch.
> 
> Signed-off-by: jiawen <1298662399@qq.com>
> ---
> diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-rzv2m.c
> --- a/drivers/i2c/busses/i2c-rzv2m.c
> +++ b/drivers/i2c/busses/i2c-rzv2m.c
> @@ -461,7 +461,12 @@
>  
>  	pm_runtime_enable(dev);
>  
> -	pm_runtime_get_sync(dev);
> +	ret = pm_runtime_get_sync(dev);
> +	if (ret < 0) {
> +		pm_runtime_put_noidle(dev);
> +		return ret;
> +	}

Please, consider using managed resources.

Thanks,
Andi