[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220108214345.1848470-7-mkl@pengutronix.de>
Date: Sat, 8 Jan 2022 22:43:29 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, linux-can@...r.kernel.org,
kernel@...gutronix.de, Marc Kleine-Budde <mkl@...gutronix.de>
Subject: [PATCH net-next 06/22] can: mcp251xfd: mcp251xfd_open(): make use of pm_runtime_resume_and_get()
With patch
| dd8088d5a896 PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter
the usual pm_runtime_get_sync() and pm_runtime_put_noidle()
in-case-of-error dance is no longer needed. Convert the mcp251xfd
driver to use this function.
Link: https://lore.kernel.org/all/20220105154300.1258636-6-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 161e12cdf8e8..a01a3fc3b13c 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -2507,11 +2507,9 @@ static int mcp251xfd_open(struct net_device *ndev)
if (err)
return err;
- err = pm_runtime_get_sync(ndev->dev.parent);
- if (err < 0) {
- pm_runtime_put_noidle(ndev->dev.parent);
+ err = pm_runtime_resume_and_get(ndev->dev.parent);
+ if (err)
goto out_close_candev;
- }
err = mcp251xfd_ring_alloc(priv);
if (err)
--
2.34.1
Powered by blists - more mailing lists