can: peak_usb: pcan_usb_get_device_id(): read value only in case of success

In case of error, reading value from response argument is useless.

Link: https://lore.kernel.org/r/20210625130931.27438-2-s.grosjean@peak-system.com
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Stephane Grosjean 2021-06-25 15:09:27 +02:00 committed by Marc Kleine-Budde
parent 805ff68c8e
commit 1d0214a0f5
1 changed files with 2 additions and 1 deletions

View File

@ -384,6 +384,7 @@ static int pcan_usb_get_device_id(struct peak_usb_device *dev, u32 *device_id)
if (err)
netdev_err(dev->netdev, "getting device id failure: %d\n", err);
else
*device_id = args[0];
return err;