Commit 51252cc5 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau
Browse files

mt76: move mt76_token_init in mt76_alloc_device



In order to remove duplicated code, move mt76_token_init in
mt76_alloc_device routine

Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 2bf301bc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -428,6 +428,9 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
	mutex_init(&dev->mcu.mutex);
	dev->tx_worker.fn = mt76_tx_worker;

	spin_lock_init(&dev->token_lock);
	idr_init(&dev->token);

	INIT_LIST_HEAD(&dev->txwi_cache);

	for (i = 0; i < ARRAY_SIZE(dev->q_rx); i++)
+0 −1
Original line number Diff line number Diff line
@@ -1220,7 +1220,6 @@ s8 mt76_get_rate_power_limits(struct mt76_phy *phy,
struct mt76_txwi_cache *
mt76_token_release(struct mt76_dev *dev, int token, bool *wake);
int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi);
void mt76_token_init(struct mt76_dev *dev);
void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked);

static inline void mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked)
+0 −2
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ static int mt7615_init_hardware(struct mt7615_dev *dev)
	mt76_wr(dev, MT_INT_SOURCE_CSR, ~0);

	INIT_WORK(&dev->mcu_work, mt7615_pci_init_work);
	mt76_token_init(&dev->mt76);

	ret = mt7615_eeprom_init(dev, addr);
	if (ret < 0)
		return ret;
+0 −2
Original line number Diff line number Diff line
@@ -351,8 +351,6 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
	mt76_wr(dev, MT_INT_SOURCE_CSR, ~0);

	INIT_WORK(&dev->init_work, mt7915_init_work);
	mt76_token_init(&dev->mt76);

	dev->dbdc_support = !!(mt76_rr(dev, MT_HW_BOUND) & BIT(5));

	/* If MCU was already running, it is likely in a bad state */
+0 −1
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@ static int mt7921_init_hardware(struct mt7921_dev *dev)
{
	int ret, idx;

	mt76_token_init(&dev->mt76);
	ret = mt7921_dma_init(dev);
	if (ret)
		return ret;
Loading