lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANEJEGu2fe6MEFxd3cofeP1QQU=7kLW7EixxJ3CQmsrzsPjWPw@mail.gmail.com>
Date: Fri, 1 Dec 2023 18:14:29 -0800
From: Grant Grundler <grundler@...omium.org>
To: Douglas Anderson <dianders@...omium.org>
Cc: linux-usb@...r.kernel.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	"David S . Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Grant Grundler <grundler@...omium.org>, Hayes Wang <hayeswang@...ltek.com>, 
	Simon Horman <horms@...nel.org>, Bjørn Mork <bjorn@...k.no>, 
	netdev@...r.kernel.org, Brian Geffon <bgeffon@...gle.com>, 
	Alan Stern <stern@...land.harvard.edu>, Hans de Goede <hdegoede@...hat.com>, 
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>, "Rafael J. Wysocki" <rafael@...nel.org>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] usb: core: Don't force USB generic_subclass
 drivers to define probe()

On Fri, Dec 1, 2023 at 10:31 AM Douglas Anderson <dianders@...omium.org> wrote:
>
> There's no real reason that subclassed USB drivers _need_ to define
> probe() since they might want to subclass for some other reason. Make
> it optional to define probe() if we're a generic_subclass.
>
> Signed-off-by: Douglas Anderson <dianders@...omium.org>

Reviewed-by: Grant Grundler <grundler@...omium.org>

Thanks for pursuing this Doug!

cheers,
grant

> ---
>
> Changes in v2:
> - ("Don't force USB generic_subclass drivers to define ...") new for v2.
>
>  drivers/usb/core/driver.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
> index f58a0299fb3b..1dc0c0413043 100644
> --- a/drivers/usb/core/driver.c
> +++ b/drivers/usb/core/driver.c
> @@ -290,7 +290,10 @@ static int usb_probe_device(struct device *dev)
>          * specialised device drivers prior to setting the
>          * use_generic_driver bit.
>          */
> -       error = udriver->probe(udev);
> +       if (udriver->probe)
> +               error = udriver->probe(udev);
> +       else if (!udriver->generic_subclass)
> +               error = -EINVAL;
>         if (error == -ENODEV && udriver != &usb_generic_driver &&
>             (udriver->id_table || udriver->match)) {
>                 udev->use_generic_driver = 1;
> --
> 2.43.0.rc2.451.g8631bc7472-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ