Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8a374648b58e5cfa14447eca866aed14a4fbfa8
Commit:     f8a374648b58e5cfa14447eca866aed14a4fbfa8
Parent:     72230abb21349cda54d6cce0d6fd325c023b958e
Author:     Inaky Perez-Gonzalez <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 31 20:34:04 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:07 2007 -0700

    usb: usb_generic_probe() obeys authorization
    
    If called and the device is not authorized to be used, then we won't
    choose a configuration (as they are not a concept that exists for an
    unauthorized device). However, the device is added to the system.
    
    Signed-off-by: Inaky Perez-Gonzalez <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/generic.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index b2fc2b1..20b0950 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -161,17 +161,20 @@ static int generic_probe(struct usb_device *udev)
        /* Choose and set the configuration.  This registers the interfaces
         * with the driver core and lets interface drivers bind to them.
         */
-       c = choose_configuration(udev);
-       if (c >= 0) {
-               err = usb_set_configuration(udev, c);
-               if (err) {
-                       dev_err(&udev->dev, "can't set config #%d, error %d\n",
+       if (udev->authorized == 0)
+               dev_err(&udev->dev, "Device is not authorized for usage\n");
+       else {
+               c = choose_configuration(udev);
+               if (c >= 0) {
+                       err = usb_set_configuration(udev, c);
+                       if (err) {
+                               dev_err(&udev->dev, "can't set config #%d, 
error %d\n",
                                        c, err);
-                       /* This need not be fatal.  The user can try to
-                        * set other configurations. */
+                               /* This need not be fatal.  The user can try to
+                                * set other configurations. */
+                       }
                }
        }
-
        /* USB device state == configured ... usable */
        usb_notify_add_device(udev);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to