Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geliang Tang and committed by
Greg Kroah-Hartman
69ab55d7 aa742683

+2 -2
+1 -1
drivers/usb/core/devio.c
··· 848 848 (void *) (unsigned long) devt, match_devt); 849 849 if (!dev) 850 850 return NULL; 851 - return container_of(dev, struct usb_device, dev); 851 + return to_usb_device(dev); 852 852 } 853 853 854 854 /*
+1 -1
drivers/usb/core/usb.c
··· 241 241 if (!is_usb_device(dev)) 242 242 return 0; 243 243 244 - return arg->fn(container_of(dev, struct usb_device, dev), arg->data); 244 + return arg->fn(to_usb_device(dev), arg->data); 245 245 } 246 246 247 247 /**