Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f20f3a9 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: core: Do not choose configuration if actconfig is valid



Consider a case where some specific entity like userspace or
libusb has already set some configuration before usb_probe_device
could get invoked. Then usb_choose_configuration sets the config
back to some default config which can lead to desired functions
not getting chosen.
To fix this, do not allow usb_choose_configuration to set any
config if udev->actconfig is valid.

Change-Id: If5166c0610a8c402929e52a4e11a77920dee0356
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 7cab85a0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -180,7 +180,8 @@ int usb_choose_configuration(struct usb_device *udev)
			"due to insufficient available bus power\n",
			insufficient_power, plural(insufficient_power));

	if (best) {
	/* choose 'best' config only if some other config is not set already */
	if (best && !udev->actconfig) {
		i = best->desc.bConfigurationValue;
		dev_dbg(&udev->dev,
			"configuration #%d chosen from %d choice%s\n",