mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
can: m_can: m_can_get_berr_counter(): don't wake up controller if interface is down
If the interface is down, the CAN controller might be powered down, the clock disabled, and/or it's external reset asserted. Don't wake up the controller to read the CAN bus error counters, if the interface is down. Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com> Link: https://patch.msgid.link/20251008-m_can-cleanups-v1-7-1784a18eaa84@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
b24b43522e
commit
91a55c72a8
|
|
@ -791,6 +791,10 @@ static int m_can_get_berr_counter(const struct net_device *dev,
|
|||
struct m_can_classdev *cdev = netdev_priv(dev);
|
||||
int err;
|
||||
|
||||
/* Avoid waking up the controller if the interface is down */
|
||||
if (!(dev->flags & IFF_UP))
|
||||
return 0;
|
||||
|
||||
err = m_can_clk_start(cdev);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user