With this patch, the driver uses the dev_port field of struct net_device to store the value it has read from the flash memory of the USB device. The old private field device_number has become useless and is removed. Signed-off-by: Stephane Grosjean <s.grosjean@xxxxxxxxxxxxxxx> --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 4 ++-- drivers/net/can/usb/peak_usb/pcan_usb_core.h | 1 - drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 -- 3 files changed, 2 insertions(+), 5 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 338a7eb3f8fc..7f71549a5bc0 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c @@ -948,11 +948,11 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, __le32 ledevid; if (!dev->adapter->dev_get_user_devid(dev, &ledevid)) - dev->device_number = le32_to_cpu(ledevid); + netdev->dev_port = le32_to_cpu(ledevid); } netdev_info(netdev, "attached to %s channel %u (device %u)\n", - peak_usb_adapter->name, ctrl_idx, dev->device_number); + peak_usb_adapter->name, ctrl_idx, netdev->dev_port); return 0; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.h b/drivers/net/can/usb/peak_usb/pcan_usb_core.h index a181684474fc..5b06b57bcf32 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h @@ -123,7 +123,6 @@ struct peak_usb_device { u8 *cmd_buf; struct usb_anchor rx_submitted; - u32 device_number; u8 device_rev; u8 ep_msg_in; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index 61f0e5b3916f..9f6712f8610e 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c @@ -976,8 +976,6 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev) } pdev->usb_if->dev[dev->ctrl_idx] = dev; - dev->device_number = - le32_to_cpu(pdev->usb_if->fw_info.dev_id[dev->ctrl_idx]); /* set clock domain */ for (i = 0; i < ARRAY_SIZE(pcan_usb_fd_clk_freq); i++) -- 2.25.1