mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
unify drvdata handling
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -166,6 +166,8 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
|
||||
struct wiphy *wiphy = hw->wiphy;
|
||||
int ret;
|
||||
|
||||
dev_set_drvdata(dev->dev, dev);
|
||||
|
||||
spin_lock_init(&dev->lock);
|
||||
INIT_LIST_HEAD(&dev->txwi_cache);
|
||||
|
||||
|
||||
+2
-3
@@ -48,8 +48,6 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
dev->mt76.rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) |
|
||||
(mt76_rr(dev, MT_HW_REV) & 0xff);
|
||||
dev_printk(KERN_INFO, dev->mt76.dev, "ASIC revision: %04x\n", dev->mt76.rev);
|
||||
@@ -72,7 +70,8 @@ error:
|
||||
static void
|
||||
mt76pci_remove(struct pci_dev *pdev)
|
||||
{
|
||||
struct mt7603_dev *dev = pci_get_drvdata(pdev);
|
||||
struct mt76_dev *mdev = pci_get_drvdata(pdev);
|
||||
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
|
||||
|
||||
mt76_unregister_device(&dev->mt76);
|
||||
mt7603_mcu_exit(dev);
|
||||
|
||||
+4
-5
@@ -49,8 +49,6 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
dev->mt76.rev = mt76_rr(dev, MT_ASIC_VERSION);
|
||||
dev_printk(KERN_INFO, dev->mt76.dev, "ASIC revision: %08x\n", dev->mt76.rev);
|
||||
|
||||
@@ -84,11 +82,12 @@ error:
|
||||
static void
|
||||
mt76pci_remove(struct pci_dev *pdev)
|
||||
{
|
||||
struct mt76x2_dev *dev = pci_get_drvdata(pdev);
|
||||
struct mt76_dev *mdev = pci_get_drvdata(pdev);
|
||||
struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76);
|
||||
|
||||
ieee80211_unregister_hw(mt76_hw(dev));
|
||||
ieee80211_unregister_hw(mdev->hw);
|
||||
mt76x2_cleanup(dev);
|
||||
ieee80211_free_hw(mt76_hw(dev));
|
||||
ieee80211_free_hw(mdev->hw);
|
||||
}
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, mt76pci_device_table);
|
||||
|
||||
Reference in New Issue
Block a user