]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: wilc1000: register net device only after bus being fully initialized
authorAlexis Lothoré <alexis.lothore@bootlin.com>
Tue, 14 May 2024 15:51:20 +0000 (17:51 +0200)
committerKalle Valo <kvalo@kernel.org>
Fri, 17 May 2024 08:01:51 +0000 (11:01 +0300)
commitec99908906e9e322b3d0a34822be44a4659452de
tree9bdc453d2a8fa819c3782950bba40912a7212725
parent6fe46d5c0a84471e06fa5b22d7f4253ebf98b071
wifi: wilc1000: register net device only after bus being fully initialized

SDIO/SPI probes functions automatically add a default wlan interface on top
of registered wiphy, through wilc_cfg80211_init which in turn calls
wilc_netdev_ifc_init. However, bus is still not fully initialized when we
register corresponding net device (for example we still miss some private
driver data pointers), which for example makes it impossible to
retrieve MAC address from chip (which is supposed to be set on net device
before its registration) before registering net device. More generally, net
device registration should not be done until driver has fully initialized
everything and is ready to handle any operation  on the net device.

Prevent net device from being registered so early by doing it at the end of
probe functions. Apply this logic to both sdio and spi buses.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240514-mac_addr_at_probe-v2-2-afef09f1cd10@bootlin.com
drivers/net/wireless/microchip/wilc1000/cfg80211.c
drivers/net/wireless/microchip/wilc1000/netdev.c
drivers/net/wireless/microchip/wilc1000/sdio.c
drivers/net/wireless/microchip/wilc1000/spi.c