Skip to contentSkip to conversation

FAILED: patch "[PATCH] can: m_can: Fix runtime resume call" failed to apply to 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jul 27, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 1675bee3e732c2449e792feed9caff804f3bd42c Mon Sep 17 00:00:00 2001

From: Faiz Abbas <[email protected]>
Date: Tue, 3 Jul 2018 16:41:02 +0530
Subject: [PATCH] can: m_can: Fix runtime resume call

pm_runtime_get_sync() returns a 1 if the state of the device is already 'active'. This is not a failure case and should return a success.

Therefore fix error handling for pm_runtime_get_sync() call such that it returns success when the value is 1.

Also cleanup the TODO for using runtime PM for sleep mode as that is implemented.

drivers/net/can/m_can/m_can.c +4 -4
index 8e2b7f873c4d..e2f965c2e3aa 100644
@@ -634,10 +634,12 @@ static int m_can_clk_start(struct m_can_priv *priv)
 	int err;
 
 	err = pm_runtime_get_sync(priv->device);
-	if (err)
+	if (err < 0) {
 		pm_runtime_put_noidle(priv->device);
+		return err;
+	}
 
-	return err;
+	return 0;
 }
 
 static void m_can_clk_stop(struct m_can_priv *priv)
@@ -1688,8 +1690,6 @@ static int m_can_plat_probe(struct platform_device *pdev)
 	return ret;
 }
 
-/* TODO: runtime PM with power down or sleep mode  */
-
 static __maybe_unused int m_can_suspend(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);