diff options
author | Yajun Deng <yajun.deng@linux.dev> | 2024-01-04 04:28:22 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-04 16:06:32 +0100 |
commit | 49a78b05d5ca1e23fd737747a8757b8bdc319b30 (patch) | |
tree | 9b6c082d0f6101495782b1501710d9771f0c4cea /drivers/usb/misc | |
parent | arm64: dts: mediatek: mt8195: Add 'rx-fifo-depth' for cherry (diff) | |
download | linux-49a78b05d5ca1e23fd737747a8757b8bdc319b30.tar.xz linux-49a78b05d5ca1e23fd737747a8757b8bdc319b30.zip |
USB: core: Use device_driver directly in struct usb_driver and usb_device_driver
There is usbdrv_wrap in struct usb_driver and usb_device_driver, it
contains device_driver and for_devices. for_devices is used to
distinguish between device drivers and interface drivers.
Like the is_usb_device(), it tests the type of the device. We can test
that if the probe of device_driver is equal to usb_probe_device in
is_usb_device_driver(), and then the struct usbdrv_wrap is no longer
needed.
Clean up struct usbdrv_wrap, use device_driver directly in struct
usb_driver and usb_device_driver. This makes the code cleaner.
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20240104032822.1896596-1-yajun.deng@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/onboard_usb_hub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c index c09fb6bd7d7d..0dd2b032c90b 100644 --- a/drivers/usb/misc/onboard_usb_hub.c +++ b/drivers/usb/misc/onboard_usb_hub.c @@ -244,7 +244,7 @@ static void onboard_hub_attach_usb_driver(struct work_struct *work) { int err; - err = driver_attach(&onboard_hub_usbdev_driver.drvwrap.driver); + err = driver_attach(&onboard_hub_usbdev_driver.driver); if (err) pr_err("Failed to attach USB driver: %pe\n", ERR_PTR(err)); } |