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

Commit 8dfd3fe5 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: es1: separate urb allocation and submission



Separate in-urb allocation and submission.

This is needed for the driver-model rework.

Compile-tested only.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 0ce68ce4
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -650,7 +650,7 @@ static int ap_probe(struct usb_interface *interface,
		goto error;
		goto error;
	}
	}


	/* Allocate buffers for our cport in messages and start them up */
	/* Allocate buffers for our cport in messages */
	for (i = 0; i < NUM_CPORT_IN_URB; ++i) {
	for (i = 0; i < NUM_CPORT_IN_URB; ++i) {
		struct urb *urb;
		struct urb *urb;
		u8 *buffer;
		u8 *buffer;
@@ -668,9 +668,6 @@ static int ap_probe(struct usb_interface *interface,
				  cport_in_callback, hd);
				  cport_in_callback, hd);
		es1->cport_in_urb[i] = urb;
		es1->cport_in_urb[i] = urb;
		es1->cport_in_buffer[i] = buffer;
		es1->cport_in_buffer[i] = buffer;
		retval = usb_submit_urb(urb, GFP_KERNEL);
		if (retval)
			goto error;
	}
	}


	/* Allocate urbs for our CPort OUT messages */
	/* Allocate urbs for our CPort OUT messages */
@@ -689,6 +686,13 @@ static int ap_probe(struct usb_interface *interface,
							(S_IWUSR | S_IRUGO),
							(S_IWUSR | S_IRUGO),
							gb_debugfs_get(), es1,
							gb_debugfs_get(), es1,
							&apb1_log_enable_fops);
							&apb1_log_enable_fops);

	for (i = 0; i < NUM_CPORT_IN_URB; ++i) {
		retval = usb_submit_urb(es1->cport_in_urb[i], GFP_KERNEL);
		if (retval)
			goto error;
	}

	return 0;
	return 0;
error:
error:
	ap_disconnect(interface);
	ap_disconnect(interface);