mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: move initialization of some struct members to mt76_alloc_device
Reduces duplication and prepares for further rework Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+6
-2
@@ -275,6 +275,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
|
||||
{
|
||||
struct ieee80211_hw *hw;
|
||||
struct mt76_dev *dev;
|
||||
int i;
|
||||
|
||||
hw = ieee80211_alloc_hw(size, ops);
|
||||
if (!hw)
|
||||
@@ -292,6 +293,11 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
|
||||
init_waitqueue_head(&dev->tx_wait);
|
||||
skb_queue_head_init(&dev->status_list);
|
||||
|
||||
INIT_LIST_HEAD(&dev->txwi_cache);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dev->q_rx); i++)
|
||||
skb_queue_head_init(&dev->rx_skb[i]);
|
||||
|
||||
tasklet_init(&dev->tx_tasklet, mt76_tx_tasklet, (unsigned long)dev);
|
||||
|
||||
return dev;
|
||||
@@ -307,8 +313,6 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
|
||||
|
||||
dev_set_drvdata(dev->dev, dev);
|
||||
|
||||
INIT_LIST_HEAD(&dev->txwi_cache);
|
||||
|
||||
SET_IEEE80211_DEV(hw, dev->dev);
|
||||
SET_IEEE80211_PERM_ADDR(hw, dev->macaddr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user