Re: [PATCH v9 07/14] can: peak_usb: register the netdevs only once all channels are set up

From: Stéphane Grosjean

Date: Thu Nov 26 2026 - 07:03:40 EST


On 26/11/2026 10:11, sashiko-bot@xxxxxxxxxx wrote:
[...]
> [Severity: Low]
> Should the command helpers called during probe before register_candev()
> also use dev_err() instead of netdev_err()?
>
> pcan_usb_get_can_channel_id(), dev_init(), and dev_set_bus() call helpers
> such as pcan_usb_wait_rsp(), pcan_usb_send_cmd(), pcan_usb_pro_send_cmd(),
> pcan_usb_pro_wait_rsp(), pcan_usb_pro_send_req(), and
> pcan_usb_fd_send_cmd(), which still log errors via netdev_err(dev->netdev,
> ...) on an unregistered net_device during peak_usb_create_dev().

Yes, they should, but not in this patch. Since this patch calls
dev_init(), dev_set_bus() and dev_get_can_channel_id() before
register_candev(), their error messages, if any, now get the
"(unnamed net_device) (uninitialized)" prefix. The same point was
raised on v6 and answered there [1]: these helpers only log on error,
and since SET_NETDEV_DEV() has already been called, the message is
still printed and attached to the USB interface: only its prefix is
wrong. Converting all of them would make this Fixes: patch grow for a
cosmetic issue, so I'll do it in a separate patch for linux-can-next.

[1] https://lore.kernel.org/r/20261030102705.30262-4-stephane.grosjean@xxxxxxx

Thanks!

Stéphane