Commit 7a265ed8 authored by Pavel Pisa's avatar Pavel Pisa

driver: Fix PCI driver exception when signature not found.

When core is reload but PCI bus is not scanned again then reads
from stale regions return 0xff. Return value of ctucan_probe_common()
does not return negative value in such case which leads to attempt
to setup multiple instances.
Signed-off-by: Pavel Pisa's avatarPavel Pisa <pisa@cmp.felk.cvut.cz>
parent e015bf36
...@@ -1056,6 +1056,7 @@ int ctucan_probe_common(struct device *dev, void __iomem *addr, ...@@ -1056,6 +1056,7 @@ int ctucan_probe_common(struct device *dev, void __iomem *addr,
if ((priv->p.read_reg(&priv->p, CTU_CAN_FD_DEVICE_ID) & if ((priv->p.read_reg(&priv->p, CTU_CAN_FD_DEVICE_ID) &
0xFFFF) != CTU_CAN_FD_ID) { 0xFFFF) != CTU_CAN_FD_ID) {
netdev_err(ndev, "CTU_CAN_FD signature not found\n"); netdev_err(ndev, "CTU_CAN_FD signature not found\n");
ret = -ENODEV;
goto err_disableclks; goto err_disableclks;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment