]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
igc: fix a log entry using uninitialized netdev
authorCorinna Vinschen <vinschen@redhat.com>
Tue, 23 Apr 2024 10:24:54 +0000 (12:24 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 8 May 2024 16:25:44 +0000 (09:25 -0700)
commit86167183a17e03ec77198897975e9fdfbd53cb0b
tree01ffc4ae66b570fa6b72819aa3c565880b53af39
parent8e3a90f2e3aa642d0e7e8259f069ca539cecf549
igc: fix a log entry using uninitialized netdev

During successful probe, igc logs this:

[    5.133667] igc 0000:01:00.0 (unnamed net_device) (uninitialized): PHC added
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The reason is that igc_ptp_init() is called very early, even before
register_netdev() has been called. So the netdev_info() call works
on a partially uninitialized netdev.

Fix this by calling igc_ptp_init() after register_netdev(), right
after the media autosense check, just as in igb.  Add a comment,
just as in igb.

Now the log message is fine:

[    5.200987] igc 0000:01:00.0 eth0: PHC added

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc_main.c