mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-04 02:38:54 +00:00
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 <inaky@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
72230abb21
commit
f8a374648b
1 changed files with 11 additions and 8 deletions
|
@ -161,17 +161,20 @@ static int generic_probe(struct usb_device *udev)
|
||||||
/* Choose and set the configuration. This registers the interfaces
|
/* Choose and set the configuration. This registers the interfaces
|
||||||
* with the driver core and lets interface drivers bind to them.
|
* with the driver core and lets interface drivers bind to them.
|
||||||
*/
|
*/
|
||||||
c = choose_configuration(udev);
|
if (udev->authorized == 0)
|
||||||
if (c >= 0) {
|
dev_err(&udev->dev, "Device is not authorized for usage\n");
|
||||||
err = usb_set_configuration(udev, c);
|
else {
|
||||||
if (err) {
|
c = choose_configuration(udev);
|
||||||
dev_err(&udev->dev, "can't set config #%d, error %d\n",
|
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);
|
c, err);
|
||||||
/* This need not be fatal. The user can try to
|
/* This need not be fatal. The user can try to
|
||||||
* set other configurations. */
|
* set other configurations. */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USB device state == configured ... usable */
|
/* USB device state == configured ... usable */
|
||||||
usb_notify_add_device(udev);
|
usb_notify_add_device(udev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue