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

Commit deeb7b42 authored by Amit Pundir's avatar Amit Pundir
Browse files

Revert "usb: gadget: composite: Fix corruption when changing configuration"



This reverts commit c5c7f4d3.

We do not need this fix with Android ConfigFS gadgets.

Change-Id: I7dffb884a49ecb2f5d619150edfa3e51808ef8cc
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 47be4c18
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -845,7 +845,7 @@ done:
}
EXPORT_SYMBOL_GPL(usb_add_config);

static void unbind_config(struct usb_composite_dev *cdev,
static void remove_config(struct usb_composite_dev *cdev,
			      struct usb_configuration *config)
{
	while (!list_empty(&config->functions)) {
@@ -860,6 +860,7 @@ static void unbind_config(struct usb_composite_dev *cdev,
			/* may free memory for "f" */
		}
	}
	list_del(&config->list);
	if (config->unbind) {
		DBG(cdev, "unbind config '%s'/%p\n", config->label, config);
		config->unbind(config);
@@ -886,11 +887,9 @@ void usb_remove_config(struct usb_composite_dev *cdev,
	if (cdev->config == config)
		reset_config(cdev);

	list_del(&config->list);

	spin_unlock_irqrestore(&cdev->lock, flags);

	unbind_config(cdev, config);
	remove_config(cdev, config);
}

/*-------------------------------------------------------------------------*/
@@ -1825,8 +1824,7 @@ static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)
		struct usb_configuration	*c;
		c = list_first_entry(&cdev->configs,
				struct usb_configuration, list);
		list_del(&c->list);
		unbind_config(cdev, c);
		remove_config(cdev, c);
	}
	if (cdev->driver->unbind && unbind_driver)
		cdev->driver->unbind(cdev);