[PATCH] net: renesas: rswitch-main: fix runtime PM cleanup

From: Jiawen Liu

Date: Tue Aug 18 2026 - 08:50:02 EST


From: jiawen <1298662399@xxxxxx>

Update renesas_eth_sw_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@xxxxxx>
---
diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c
--- a/drivers/net/ethernet/renesas/rswitch_main.c
+++ b/drivers/net/ethernet/renesas/rswitch_main.c
@@ -2123,6 +2123,8 @@
{ /* Sentinel */ }
};

+static void rswitch_deinit(struct rswitch_private *priv);
+
static int renesas_eth_sw_probe(struct platform_device *pdev)
{
const struct soc_device_attribute *attr;
@@ -2194,6 +2196,9 @@
ret = rswitch_register_notifiers();
if (ret) {
dev_err(&pdev->dev, "could not register notifiers\n");
+ rswitch_deinit(priv);
+ pm_runtime_put(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
return ret;
}