summaryrefslogtreecommitdiff
path: root/drivers/net/can/c_can
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-12-03 15:42:13 -0800
committerJakub Kicinski <kuba@kernel.org>2020-12-03 15:44:09 -0800
commit55fd59b003f6e8fd88cf16590e79823d7ccf3026 (patch)
treef23b2225f1a00b80632d612428708d5a57ad330b /drivers/net/can/c_can
parenta4390e966f952510808b10ce7ae2a7dd2a08c0e5 (diff)
parentbbe2ba04c5a92a49db8a42c850a5a2f6481e47eb (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Conflicts: drivers/net/ethernet/ibm/ibmvnic.c Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/can/c_can')
-rw-r--r--drivers/net/can/c_can/c_can.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 0420f09f2b70..63f48b016ecd 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1295,12 +1295,22 @@ int c_can_power_up(struct net_device *dev)
time_after(time_out, jiffies))
cpu_relax();
- if (time_after(jiffies, time_out))
- return -ETIMEDOUT;
+ if (time_after(jiffies, time_out)) {
+ ret = -ETIMEDOUT;
+ goto err_out;
+ }
ret = c_can_start(dev);
- if (!ret)
- c_can_irq_control(priv, true);
+ if (ret)
+ goto err_out;
+
+ c_can_irq_control(priv, true);
+
+ return 0;
+
+err_out:
+ c_can_reset_ram(priv, false);
+ c_can_pm_runtime_put_sync(priv);
return ret;
}