wifi: qtnfmac: allocate dummy net_device dynamically
authorBreno Leitao <leitao@debian.org>
Tue, 19 Mar 2024 17:26:19 +0000 (10:26 -0700)
committerKalle Valo <kvalo@kernel.org>
Thu, 21 Mar 2024 15:09:25 +0000 (17:09 +0200)
commit61cdb09ff760dd32439cde1200a1a8bd208807cd
tree16f62c86fee566c1cde4fe7b7ae56d5807f00762
parent2d5cde1143eca31c72547dfd589702c6b4a7e684
wifi: qtnfmac: allocate dummy net_device dynamically

Embedding net_device into structures prohibits the usage of flexible
arrays in the net_device structure. For more details, see the discussion
at [1].

Un-embed the net_device from struct qtnf_bus by converting it
into a pointer. Then use the leverage alloc_netdev() to allocate the
net_device object at qtnf_pcie_probe(). The free of the device occurs at
qtnf_pcie_remove().

[1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240319172634.894327-1-leitao@debian.org
drivers/net/wireless/quantenna/qtnfmac/bus.h
drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c
drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c