From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
kernel@pengutronix.de, Johan Hovold <johan@kernel.org>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 3/6] can: peak_usb: fix product-id endianness in error message
Date: Fri, 9 Jun 2017 14:55:10 +0200 [thread overview]
Message-ID: <20170609125513.24436-4-mkl@pengutronix.de> (raw)
In-Reply-To: <20170609125513.24436-1-mkl@pengutronix.de>
From: Johan Hovold <johan@kernel.org>
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 | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 57913dbbae0a..1ca76e03e965 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -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;
}
--
2.11.0
next prev parent reply other threads:[~2017-06-09 12:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 12:55 pull-request: can 2017-06-09 Marc Kleine-Budde
2017-06-09 12:55 ` [PATCH 1/6] can: dev: make can_change_state() robust to be called with cf == NULL Marc Kleine-Budde
2017-06-09 12:55 ` [PATCH 2/6] can: peak_canfd: fix uninitialized symbol warnings Marc Kleine-Budde
2017-06-09 12:55 ` Marc Kleine-Budde [this message]
2017-06-09 12:55 ` [PATCH 4/6] can: gs_usb: fix memory leak in gs_cmd_reset() Marc Kleine-Budde
2017-06-09 12:55 ` [PATCH 5/6] can: af_can: namespace support: fix lockdep splat: properly initialize spin_lock Marc Kleine-Budde
2017-06-09 12:55 ` [PATCH 6/6] can: enable CAN FD for virtual CAN devices by default Marc Kleine-Budde
2017-06-09 19:42 ` pull-request: can 2017-06-09 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170609125513.24436-4-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=johan@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).