mt76usb: use usb_dev private data

Setup usb device private data. This allows to remove mt76u_buf->dev
and simplify some routines as no longer we need to get usb device
through usb interface.

Signed-off-by: Stanislaw Gruszka <[email protected]>
This commit is contained in:
Stanislaw Gruszka
2019-03-24 08:24:28 +01:00
committed by Felix Fietkau
parent e1bfbeb162
commit e9c017190e
4 changed files with 9 additions and 14 deletions
+3 -1
View File
@@ -50,7 +50,7 @@ static int mt76x2u_probe(struct usb_interface *intf,
struct mt76_dev *mdev;
int err;
mdev = mt76_alloc_device(&intf->dev, sizeof(*dev), &mt76x2u_ops,
mdev = mt76_alloc_device(&udev->dev, sizeof(*dev), &mt76x2u_ops,
&drv_ops);
if (!mdev)
return -ENOMEM;
@@ -60,6 +60,8 @@ static int mt76x2u_probe(struct usb_interface *intf,
udev = usb_get_dev(udev);
usb_reset_device(udev);
usb_set_intfdata(intf, dev);
mt76x02u_init_mcu(mdev);
err = mt76u_init(mdev, intf);
if (err < 0)