can: peak_usb: align CAN channel ID format in log with sysfs attribute
authorLukas Magel <lukas.magel@posteo.net>
Mon, 16 Jan 2023 20:09:31 +0000 (20:09 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 2 Feb 2023 16:39:27 +0000 (17:39 +0100)
Previously, the CAN channel ID was printed to the kernel log in decimal
upon connecting a new PEAK device. This behavior is inconsistent with
the hexadecimal format of the CAN channel ID sysfs attribute. This patch
updates the log message to output the id in hexadecimal.

Signed-off-by: Lukas Magel <lukas.magel@posteo.net>
Link: https://lore.kernel.org/all/20230116200932.157769-8-lukas.magel@posteo.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb_core.c

index 676923bd4213ba106a539fc3b1e7990fcd3ff5a2..2bd62c8f2b2531cb1b7165564e3010092d37adc1 100644 (file)
@@ -1029,8 +1029,8 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
        /* get CAN channel id early */
        dev->adapter->dev_get_can_channel_id(dev, &dev->can_channel_id);
 
-       netdev_info(netdev, "attached to %s channel %u (device %u)\n",
-                       peak_usb_adapter->name, ctrl_idx, dev->can_channel_id);
+       netdev_info(netdev, "attached to %s channel %u (device 0x%08X)\n",
+                   peak_usb_adapter->name, ctrl_idx, dev->can_channel_id);
 
        return 0;