Re: [PATCH net] net: lan743x: avoid netdev-based logging before netdev registration
From: Jakub Kicinski
Date: Tue May 19 2026 - 21:41:59 EST
On Fri, 15 May 2026 21:52:29 +0000 David Thompson wrote:
> This patch updates the lan743x driver to prevent the use of netdev-based
> logging APIs (such as netdev_dbg) before the network device has been
> successfully registered. Using netdev-based logging prior to registration
> results in log messages referencing "(unnamed net_device) (uninitialized)",
> which can be confusing and less informative.
>
> The driver must use netif_msg_x APIs and device-based logging (e.g. dev_dbg)
> until netdev registration is complete. This ensures log entries are
> associated with the correct device context and improves log clarity. After
> registration, netdev-based logging APIs can be used safely.
>
> Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
Not a fix
> Signed-off-by: David Thompson <davthompson@xxxxxxxxxx>
> ---
> drivers/net/ethernet/microchip/lan743x_main.c | 72 ++++++++++++-------
> 1 file changed, 45 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index f3332417162e..53492573f08d 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -108,9 +108,10 @@ static int lan743x_pci_init(struct lan743x_adapter *adapter,
> if (ret)
> goto return_error;
>
> - netif_info(adapter, probe, adapter->netdev,
> - "PCI: Vendor ID = 0x%04X, Device ID = 0x%04X\n",
> - pdev->vendor, pdev->device);
> + if (netif_msg_probe(adapter))
please drop these checks. They are always true.
And the message categorization is not encouraged.
--
pw-bot: cr