Thread (3 messages) flat view 3 messages, 3 authors, 2024-06-21

Re: [PATCH net-next v2] wifi: mt76: un-embedd netdev from mt76_dev

From: Simon Horman <horms@kernel.org>
Date: 2024-06-20 17:19:58
Also in: linux-arm-kernel, linux-mediatek, linux-wireless, lkml

On Wed, Jun 19, 2024 at 03:52:36AM -0700, Breno Leitao wrote:
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/ (local) [1]
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---

Changelog:
 * v2:
	- Renamed mt76_from_netdev() to mt76_priv(), and returns a
	  void pointer instead of struct mt76_dev, avoiding the cast
	  later, as suggested by Simon Horman.
Thanks for the update, it looks good to me.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help