lkml.org 
[lkml]   [2023]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: core: Use device_driver directly in struct usb_driver and usb_device_driver
On Fri, Dec 15, 2023 at 02:31:01PM +0800, Yajun Deng wrote:
> 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.

Yes.

> We can compare that if 'drv->probe' is equal to usb_probe_device instead
> of using for_devices in is_usb_device_driver().

Why?

> Remove struct usbdrv_wrap, use device_driver directly in struct usb_driver
> and usb_device_driver. This makes the code more concise.

Really? What does this help out with? Are there future changes that
require this?

I'm all for cleanups, but I don't see what this helps with.

Also, you have a coding style issue in this patch, which means I
couldn't take it anyway:

> +extern int usb_probe_device(struct device *dev);

We don't do that in .c files :(

thanks,

greg k-h

\
 
 \ /
  Last update: 2023-12-15 13:42    [W:0.114 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site