diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-04-18 18:45:40 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-04-21 20:55:53 +0200 |
commit | 75e83c2035debe419ba25f6dc66fcd11d0dc0bcd (patch) | |
tree | f984e3f7f75b5472d8c88feb5cd121d3a301c4d3 /drivers/net | |
parent | a61826203ba8806b4cdffd36bafdce3e9ad35c24 (diff) | |
download | lwn-75e83c2035debe419ba25f6dc66fcd11d0dc0bcd.tar.gz lwn-75e83c2035debe419ba25f6dc66fcd11d0dc0bcd.zip |
mt76: mt7615: rely on pm refcounting in mt7615_led_set_config
Rely on mt76_connac_pm_ref/mt76_connac_pm_unref utility routines in
mt7615_led_set_config
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c index 49540b00519d..736d19699a03 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci_init.c @@ -82,7 +82,7 @@ mt7615_led_set_config(struct led_classdev *led_cdev, mt76 = container_of(led_cdev, struct mt76_dev, led_cdev); dev = container_of(mt76, struct mt7615_dev, mt76); - if (test_bit(MT76_STATE_PM, &mt76->phy.state)) + if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) return; val = FIELD_PREP(MT_LED_STATUS_DURATION, 0xffff) | @@ -100,6 +100,8 @@ mt7615_led_set_config(struct led_classdev *led_cdev, val |= MT_LED_CTRL_POLARITY(mt76->led_pin); addr = mt7615_reg_map(dev, MT_LED_CTRL); mt76_wr(dev, addr, val); + + mt76_connac_pm_unref(&dev->pm); } static int |