can: peak_usb: fix product-id endianness in error message
authorJohan Hovold <johan@kernel.org>
Fri, 12 May 2017 10:09:25 +0000 (12:09 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 9 Jun 2017 09:39:23 +0000 (11:39 +0200)
Make sure to use the USB device product-id stored in host-byte order in
a probe error message.

Also remove a redundant reassignment of the local usb_dev variable which
had already been used to retrieve the product id.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb_core.c

index 57913dbbae0a970f5f28051d10f064792d69333c..1ca76e03e965ce0b1185c3220a86cb306d89e3e5 100644 (file)
@@ -908,8 +908,6 @@ static int peak_usb_probe(struct usb_interface *intf,
        const struct peak_usb_adapter *peak_usb_adapter = NULL;
        int i, err = -ENOMEM;
 
-       usb_dev = interface_to_usbdev(intf);
-
        /* get corresponding PCAN-USB adapter */
        for (i = 0; i < ARRAY_SIZE(peak_usb_adapters_list); i++)
                if (peak_usb_adapters_list[i]->device_id == usb_id_product) {
@@ -920,7 +918,7 @@ static int peak_usb_probe(struct usb_interface *intf,
        if (!peak_usb_adapter) {
                /* should never come except device_id bad usage in this file */
                pr_err("%s: didn't find device id. 0x%x in devices list\n",
-                       PCAN_USB_DRIVER_NAME, usb_dev->descriptor.idProduct);
+                       PCAN_USB_DRIVER_NAME, usb_id_product);
                return -ENODEV;
        }