From 08f116c9ea6dfddf2a9649a10032902a4d72f6da Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Wed, 19 Jun 2024 03:52:36 -0700 Subject: 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 Signed-off-by: Breno Leitao Acked-by: Kalle Valo Link: https://patch.msgid.link/20240619105311.3144908-1-leitao@debian.org Signed-off-by: Jakub Kicinski --- drivers/net/wireless/mediatek/mt76/mt792x_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/mediatek/mt76/mt792x_dma.c') diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_dma.c b/drivers/net/wireless/mediatek/mt76/mt792x_dma.c index 5cc2d59b774a..6f9db782338e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_dma.c @@ -340,7 +340,7 @@ int mt792x_poll_rx(struct napi_struct *napi, int budget) struct mt792x_dev *dev; int done; - dev = container_of(napi->dev, struct mt792x_dev, mt76.napi_dev); + dev = mt76_priv(napi->dev); if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) { napi_complete(napi); -- cgit v1.2.3-58-ga151