diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2019-01-31 17:55:54 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-02-18 19:54:34 +0100 |
commit | c0f7b25ab8d33adbead530dfc54b999fb69d5ede (patch) | |
tree | c89f598230daf1c1f2ef367e275c7b0e3c620938 /drivers/net/wireless/mediatek/mt76/mt76x2 | |
parent | f1906fb24901460fdc0ba7c8bbfe416fb705c8a6 (diff) | |
download | linux-c0f7b25ab8d33adbead530dfc54b999fb69d5ede.tar.gz linux-c0f7b25ab8d33adbead530dfc54b999fb69d5ede.tar.bz2 linux-c0f7b25ab8d33adbead530dfc54b999fb69d5ede.zip |
mt76: move alloc_device common code in mt76_alloc_device
Move mt76x{0,2} alloc_device common code in mt76_alloc_device and
remove duplicated code
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x2')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c index 0ccaa64d97ec..d5816c7f359f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c @@ -329,13 +329,12 @@ struct mt76x02_dev *mt76x2_alloc_device(struct device *pdev) struct mt76x02_dev *dev; struct mt76_dev *mdev; - mdev = mt76_alloc_device(sizeof(*dev), &mt76x2_ops); + mdev = mt76_alloc_device(pdev, sizeof(*dev), &mt76x2_ops, + &drv_ops); if (!mdev) return NULL; dev = container_of(mdev, struct mt76x02_dev, mt76); - mdev->dev = pdev; - mdev->drv = &drv_ops; return dev; } diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c index 3737e9fa8295..11ce106391e1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c @@ -147,13 +147,12 @@ struct mt76x02_dev *mt76x2u_alloc_device(struct device *pdev) struct mt76x02_dev *dev; struct mt76_dev *mdev; - mdev = mt76_alloc_device(sizeof(*dev), &mt76x2u_ops); + mdev = mt76_alloc_device(pdev, sizeof(*dev), &mt76x2u_ops, + &drv_ops); if (!mdev) return NULL; dev = container_of(mdev, struct mt76x02_dev, mt76); - mdev->dev = pdev; - mdev->drv = &drv_ops; return dev; } |