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

Commit 19bcb452 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by ChandanaKishori Chiluveru
Browse files

USB: gadget: android: Integrate f_midi USB MIDI gadget driver part deux



free_ep_req and alloc_ep_req are static open coded and conflicting
in f_midi.c. The exported versions are present in f_sourcesink.c.
Changed names to protect the innocent.

Change-Id: I4aee40054b5715d0532d433d23dea2bccff7ec30
Signed-off-by: default avatarMark Salyzyn <salyzyn@google.com>
Git-commit: ae2019d83ecf14454315240c16dc3136212f0da2
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 13f30edc
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ static struct usb_gadget_strings *midi_strings[] = {
	NULL,
};

static struct usb_request *alloc_ep_req(struct usb_ep *ep, unsigned length)
static struct usb_request *midi_alloc_ep_req(struct usb_ep *ep, unsigned length)
{
	struct usb_request *req;

@@ -212,7 +212,7 @@ static struct usb_request *alloc_ep_req(struct usb_ep *ep, unsigned length)
	return req;
}

static void free_ep_req(struct usb_ep *ep, struct usb_request *req)
static void midi_free_ep_req(struct usb_ep *ep, struct usb_request *req)
{
	kfree(req->buf);
	usb_ep_free_request(ep, req);
@@ -283,7 +283,7 @@ f_midi_complete(struct usb_ep *ep, struct usb_request *req)
		if (ep == midi->out_ep)
			f_midi_handle_out_data(ep, req);

		free_ep_req(ep, req);
		midi_free_ep_req(ep, req);
		return;

	case -EOVERFLOW:	/* buffer overrun on read means that
@@ -370,7 +370,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
	/* allocate a bunch of read buffers and queue them all at once. */
	for (i = 0; i < midi->qlen && err == 0; i++) {
		struct usb_request *req =
			alloc_ep_req(midi->out_ep, midi->buflen);
			midi_alloc_ep_req(midi->out_ep, midi->buflen);
		if (req == NULL)
			return -ENOMEM;

@@ -551,10 +551,10 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
		return;

	if (!req)
		req = alloc_ep_req(ep, midi->buflen);
		req = midi_alloc_ep_req(ep, midi->buflen);

	if (!req) {
		ERROR(midi, "gmidi_transmit: alloc_ep_request failed\n");
		ERROR(midi, "gmidi_transmit: midi_alloc_ep_request failed\n");
		return;
	}
	req->length = 0;
@@ -580,7 +580,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
	if (req->length > 0)
		usb_ep_queue(ep, req, GFP_ATOMIC);
	else
		free_ep_req(ep, req);
		midi_free_ep_req(ep, req);
}

static void f_midi_in_tasklet(unsigned long data)