USB: core, devio: use to_usb_device
Use to_usb_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
aa742683bb
commit
69ab55d7be
|
@ -848,7 +848,7 @@ static struct usb_device *usbdev_lookup_by_devt(dev_t devt)
|
|||
(void *) (unsigned long) devt, match_devt);
|
||||
if (!dev)
|
||||
return NULL;
|
||||
return container_of(dev, struct usb_device, dev);
|
||||
return to_usb_device(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -241,7 +241,7 @@ static int __each_dev(struct device *dev, void *data)
|
|||
if (!is_usb_device(dev))
|
||||
return 0;
|
||||
|
||||
return arg->fn(container_of(dev, struct usb_device, dev), arg->data);
|
||||
return arg->fn(to_usb_device(dev), arg->data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue