On Wed. 4 Oct. 2023, 18:18, Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote: > > Update the debug message from "restarted" to "Attempting restart", as > it is actually printed _before_ restarting the CAN device, and that > restart may fail. > > Also update the error message from printing the error number to > printing symbolic error names. > > Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> > --- > drivers/net/can/dev/dev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c > index 9014256c486a..8e4054e2abcc 100644 > --- a/drivers/net/can/dev/dev.c > +++ b/drivers/net/can/dev/dev.c > @@ -147,14 +147,14 @@ static void can_restart(struct net_device *dev) > netif_rx(skb); > } > > - netdev_dbg(dev, "restarted\n"); > + netdev_dbg(dev, "Attempting restart\n"); > priv->can_stats.restarts++; > > /* Now restart the device */ > netif_carrier_on(dev); > err = priv->do_set_mode(dev, CAN_MODE_START); > if (err) { > - netdev_err(dev, "Error %d during restart", err); > + netdev_err(dev, "Restart failed, error %pe\n", ERR_PTR(err)); > netif_carrier_off(dev); > } Nitpick: I would rather remove the first message and print the affirmative: "restarted" if (err) { netdev_err(dev, "Restart failed, error %pe\n", ERR_PTR(err)); netif_carrier_off(dev); } else { netdev_dbg(dev, "Restarted\n"); }