diff options
author | Faiz Abbas <faiz_abbas@ti.com> | 2018-07-03 07:11:02 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-07-23 08:34:45 -0400 |
commit | 1675bee3e732c2449e792feed9caff804f3bd42c (patch) | |
tree | 4d147b86675b1c3b4f8a1cfd68e25109b79b0e40 | |
parent | b5c1a23b17e563b656cc9bb76ce5323b997d90e8 (diff) |
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.
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Cc: <stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/m_can/m_can.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 8e2b7f873c4d..e2f965c2e3aa 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c | |||
@@ -634,10 +634,12 @@ static int m_can_clk_start(struct m_can_priv *priv) | |||
634 | int err; | 634 | int err; |
635 | 635 | ||
636 | err = pm_runtime_get_sync(priv->device); | 636 | err = pm_runtime_get_sync(priv->device); |
637 | if (err) | 637 | if (err < 0) { |
638 | pm_runtime_put_noidle(priv->device); | 638 | pm_runtime_put_noidle(priv->device); |
639 | return err; | ||
640 | } | ||
639 | 641 | ||
640 | return err; | 642 | return 0; |
641 | } | 643 | } |
642 | 644 | ||
643 | static void m_can_clk_stop(struct m_can_priv *priv) | 645 | static void m_can_clk_stop(struct m_can_priv *priv) |
@@ -1688,8 +1690,6 @@ failed_ret: | |||
1688 | return ret; | 1690 | return ret; |
1689 | } | 1691 | } |
1690 | 1692 | ||
1691 | /* TODO: runtime PM with power down or sleep mode */ | ||
1692 | |||
1693 | static __maybe_unused int m_can_suspend(struct device *dev) | 1693 | static __maybe_unused int m_can_suspend(struct device *dev) |
1694 | { | 1694 | { |
1695 | struct net_device *ndev = dev_get_drvdata(dev); | 1695 | struct net_device *ndev = dev_get_drvdata(dev); |