Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1675bee3 authored by Faiz Abbas's avatar Faiz Abbas Committed by Marc Kleine-Budde
Browse files

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: default avatarFaiz Abbas <faiz_abbas@ti.com>
Cc: <stable@vger.kernel.org
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent b5c1a23b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -634,12 +634,14 @@ 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 0;
}

static void m_can_clk_stop(struct m_can_priv *priv)
{
	pm_runtime_put_sync(priv->device);
@@ -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);