mirror of https://gitee.com/openkylin/linux.git
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: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
0ce68ce417
commit
8dfd3fe564
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue