Re: [PATCH 2/3] USB: Also check for ->match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2020-07-25 at 12:43 +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 25.07.2020 12:14, Bastien Nocera wrote:
> 
> > We only ever used a the ID table matching before, but we should
> > probably
> 
>    So "a" (actually "an") or "the"? :-)

"the" :)

I'll let the tree maintainer fixup the commit message if it's accepted
as-is.

> > also support an open-coded match function.
> > 
> > Fixes: 88b7381a939de ("USB: Select better matching USB drivers when
> > available")
> > Signed-off-by: Bastien Nocera <hadess@xxxxxxxxxx>
> > ---
> >   drivers/usb/core/generic.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/core/generic.c
> > b/drivers/usb/core/generic.c
> > index b6f2d4b44754..2b2f1ab6e36a 100644
> > --- a/drivers/usb/core/generic.c
> > +++ b/drivers/usb/core/generic.c
> > @@ -205,8 +205,9 @@ static int __check_usb_generic(struct
> > device_driver *drv, void *data)
> >   	udrv = to_usb_device_driver(drv);
> >   	if (udrv == &usb_generic_driver)
> >   		return 0;
> > -
> > -	return usb_device_match_id(udev, udrv->id_table) != NULL;
> > +	if (usb_device_match_id(udev, udrv->id_table) != NULL)
> > +		return 1;
> > +	return (udrv->match && udrv->match(udev));
> 
>     Outer () not neccesary...

I find it clearer. Unless there's a style guide that disagrees, I'll
leave this as-is.

Cheers




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux