diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-04-05 19:52:19 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-04-13 10:15:43 +0200 |
commit | 5e164a4f0aaee1b604e920a8cf99878c06fe3f11 (patch) | |
tree | b2a1585220f10d80c4a8de07e25605fe54bca23a /drivers/net/can/usb | |
parent | 426718f3fe0e4315d36edf88f11748d118558acc (diff) | |
download | lwn-5e164a4f0aaee1b604e920a8cf99878c06fe3f11.tar.gz lwn-5e164a4f0aaee1b604e920a8cf99878c06fe3f11.zip |
can: peak_usb: pcan_usb_get_serial(): remove error message from error path
The caller of pcan_usb_get_serial() already prints an error message,
so remove this one and return immediately.
Link: https://lore.kernel.org/r/20210406111622.1874957-8-mkl@pengutronix.de
Acked-by: Stephane Grosjean <s.grosjean@peak-system.com>
Tested-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index 671d589b48c1..fd5ea95fd55d 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c @@ -365,16 +365,17 @@ static int pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number) int err; err = pcan_usb_wait_rsp(dev, PCAN_USB_CMD_SN, PCAN_USB_GET, args); - if (err) { - netdev_err(dev->netdev, "getting serial failure: %d\n", err); - } else if (serial_number) { + if (err) + return err; + + if (serial_number) { __le32 tmp32; memcpy(&tmp32, args, 4); *serial_number = le32_to_cpu(tmp32); } - return err; + return 0; } /* |