Message ID | 20240601050601.1782063-3-mika.westerberg@linux.intel.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | igc: fix BUG() during the driver probe | expand |
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c index 1bb026232efc..c4a5ddbe6f34 100644 --- a/drivers/net/ethernet/intel/igc/igc_ptp.c +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c @@ -1169,9 +1169,9 @@ void igc_ptp_init(struct igc_adapter *adapter) &adapter->pdev->dev); if (IS_ERR(adapter->ptp_clock)) { adapter->ptp_clock = NULL; - netdev_err(netdev, "ptp_clock_register failed\n"); + dev_err(&adapter->pdev->dev, "ptp_clock_register failed\n"); } else if (adapter->ptp_clock) { - netdev_info(netdev, "PHC added\n"); + dev_info(&adapter->pdev->dev, "PHC added\n"); adapter->ptp_flags |= IGC_PTP_ENABLED; } }
As described in the commit 86167183a17e ("igc: fix a log entry using uninitialized netdev"), the netdev has not yet been registered so we get weird log entry like: [ 5.133667] igc 0000:01:00.0 (unnamed net_device) (uninitialized): PHC added Fix this by using the PCI device pointer instead, that's valid and available at this point. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> --- drivers/net/ethernet/intel/igc/igc_ptp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)