diff options
author | Breno Leitao <leitao@debian.org> | 2024-06-19 03:52:36 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-06-20 19:30:00 -0700 |
commit | 08f116c9ea6dfddf2a9649a10032902a4d72f6da (patch) | |
tree | 2b6f832d8cbfab7ab1ed96b846213b2411f3bae9 /drivers/net/wireless/mediatek/mt76/mt76.h | |
parent | d21a103b612c4bb149faf2b5eb25f4667378824b (diff) | |
download | lwn-08f116c9ea6dfddf2a9649a10032902a4d72f6da.tar.gz lwn-08f116c9ea6dfddf2a9649a10032902a4d72f6da.zip |
wifi: mt76: un-embedd netdev from mt76_dev
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_devices from struct mt76_dev by converting them
into pointers, and allocating them dynamically. Use the leverage
alloc_netdev_dummy() to allocate the net_device object at
mt76_dma_init().
The free of the device occurs at mt76_dma_cleanup().
Link: https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ [1]
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240619105311.3144908-1-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 11b9f22ca7f3..15f83b5adac7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -831,8 +831,8 @@ struct mt76_dev { struct mt76_mcu mcu; - struct net_device napi_dev; - struct net_device tx_napi_dev; + struct net_device *napi_dev; + struct net_device *tx_napi_dev; spinlock_t rx_lock; struct napi_struct napi[__MT_RXQ_MAX]; struct sk_buff_head rx_skb[__MT_RXQ_MAX]; |