Skip to content

Commit

Permalink
can: gs_usb: gs_can_close(): don't complain about failed device reset…
Browse files Browse the repository at this point in the history
… during ndo_stop

When the USB device is unplugged, gs_can_close() (which implements the
struct net_device_ops::ndo_stop callback) is called. In this function
an attempt is made to shut down the USB device with a USB control
message. For disconnected devices this will fail and a warning message
is printed.

Silence the driver by removing the printout of the error message if
the reset command fails.

Link: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-9-c3b9154ec605@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Marc Kleine-Budde committed Jul 28, 2023
1 parent 1494ffe commit 5c6c313
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,9 +1029,7 @@ static int gs_can_close(struct net_device *netdev)
dev->can.state = CAN_STATE_STOPPED;

/* reset the device */
rc = gs_cmd_reset(dev);
if (rc < 0)
netdev_warn(netdev, "Couldn't shutdown device (err=%d)", rc);
gs_cmd_reset(dev);

/* reset tx contexts */
for (rc = 0; rc < GS_MAX_TX_URBS; rc++) {
Expand Down

0 comments on commit 5c6c313

Please sign in to comment.