Message ID | 639acbe1bd1388d007c88b80041807c2d8f48bf2.1450876612.git.geliangtang@163.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Jiri Kosina |
Headers | show |
On Wed, 23 Dec 2015, Geliang Tang wrote: > Use to_usb_device() instead of open-coding it. > > Signed-off-by: Geliang Tang <geliangtang@163.com> > --- > drivers/hid/usbhid/usbhid.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h > index 807922b..fa47d66 100644 > --- a/drivers/hid/usbhid/usbhid.h > +++ b/drivers/hid/usbhid/usbhid.h > @@ -96,7 +96,7 @@ struct usbhid_device { > }; > > #define hid_to_usb_dev(hid_dev) \ > - container_of(hid_dev->dev.parent->parent, struct usb_device, dev) > + to_usb_device(hid_dev->dev.parent->parent) Applied to hid.git#for-4.5/upstream.
diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h index 807922b..fa47d66 100644 --- a/drivers/hid/usbhid/usbhid.h +++ b/drivers/hid/usbhid/usbhid.h @@ -96,7 +96,7 @@ struct usbhid_device { }; #define hid_to_usb_dev(hid_dev) \ - container_of(hid_dev->dev.parent->parent, struct usb_device, dev) + to_usb_device(hid_dev->dev.parent->parent) #endif
Use to_usb_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> --- drivers/hid/usbhid/usbhid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)