diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2019-03-07 13:22:21 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-03-19 17:33:33 +0200 |
commit | 40b941611bd4826b7e3e449f738af98ad22e1ce6 (patch) | |
tree | e6b4907453555d694824893d6a0d08a5b380ab54 /drivers/net/wireless/mediatek/mt76/mt76x02.h | |
parent | c0316470683af0507427c3e0660246feacdf8363 (diff) | |
download | linux-stable-40b941611bd4826b7e3e449f738af98ad22e1ce6.tar.gz linux-stable-40b941611bd4826b7e3e449f738af98ad22e1ce6.tar.bz2 linux-stable-40b941611bd4826b7e3e449f738af98ad22e1ce6.zip |
mt76x02u: check chip version on probe
Since some USB device IDs are duplicated between mt76x0u, mt7601u
and mt76x2u device, check chip version on probe and return error if
not match the driver.
Don't think this is serious issue, probe most likely will fail at
some other point for wrong device, but we do not have to configure
it if we know is not our device.
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h index b5a36d9fb2bd..07061eb4d1e1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h @@ -192,6 +192,13 @@ void mt76x02_mac_start(struct mt76x02_dev *dev); void mt76x02_init_debugfs(struct mt76x02_dev *dev); +static inline bool is_mt76x0(struct mt76x02_dev *dev) +{ + return mt76_chip(&dev->mt76) == 0x7610 || + mt76_chip(&dev->mt76) == 0x7630 || + mt76_chip(&dev->mt76) == 0x7650; +} + static inline bool is_mt76x2(struct mt76x02_dev *dev) { return mt76_chip(&dev->mt76) == 0x7612 || |