summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2020-12-12 18:55:16 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2020-12-14 14:24:11 +0100
commitb8d6255548ff9a94f1fed44b01da9602861cf84a (patch)
tree01cf7564fca24e6f6f082facf59f383cdd5a1213 /drivers
parentcan: m_can: m_can_config_endisable(): mark as static (diff)
downloadlinux-b8d6255548ff9a94f1fed44b01da9602861cf84a.tar.xz
linux-b8d6255548ff9a94f1fed44b01da9602861cf84a.zip
can: m_can: m_can_clk_start(): 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 m_can driver to use this function. Link: https://lore.kernel.org/r/20201212175518.139651-6-mkl@pengutronix.de Reviewed-by: Sean Nyekjaer <sean@geanix.com> Reviewed-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/can/m_can/m_can.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index cf876c5ec174..f258c81db0c3 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -612,18 +612,10 @@ static int __m_can_get_berr_counter(const struct net_device *dev,
static int m_can_clk_start(struct m_can_classdev *cdev)
{
- int err;
-
if (cdev->pm_clock_support == 0)
return 0;
- err = pm_runtime_get_sync(cdev->dev);
- if (err < 0) {
- pm_runtime_put_noidle(cdev->dev);
- return err;
- }
-
- return 0;
+ return pm_runtime_resume_and_get(cdev->dev);
}
static void m_can_clk_stop(struct m_can_classdev *cdev)