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

Commit b6663dd2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_mtp: Handle OS descriptors properly"

parents 15059a47 d88fbcd8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1464,6 +1464,7 @@ mtp_function_bind(struct usb_configuration *c, struct usb_function *f)
		mtp_ss_out_comp_desc.bMaxBurst = max_burst;
	}

	fi_mtp->func_inst.f = &dev->function;
	DBG(cdev, "%s speed %s: IN/%s, OUT/%s\n",
		gadget_is_superspeed(c->cdev->gadget) ? "super" :
		(gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full"),
@@ -1475,9 +1476,10 @@ static void
mtp_function_unbind(struct usb_configuration *c, struct usb_function *f)
{
	struct mtp_dev	*dev = func_to_mtp(f);
	struct mtp_instance *fi_mtp;
	struct usb_request *req;
	int i;

	fi_mtp = container_of(f->fi, struct mtp_instance, func_inst);
	mtp_string_defs[INTERFACE_STRING_INDEX].id = 0;
	mutex_lock(&dev->read_mutex);
	while ((req = mtp_req_get(dev, &dev->tx_idle)))
@@ -1490,6 +1492,7 @@ mtp_function_unbind(struct usb_configuration *c, struct usb_function *f)
	dev->state = STATE_OFFLINE;
	kfree(f->os_desc_table);
	f->os_desc_n = 0;
	fi_mtp->func_inst.f = NULL;
}

static int mtp_function_set_alt(struct usb_function *f,