summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb_wwan.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-05-26 19:23:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-27 15:04:07 -0700
commit3362c91c7841f2e4ab5b1f018a5da0ecbc924894 (patch)
treeb67a5ac116a97d643d40a8c0d91d88887259b935 /drivers/usb/serial/usb_wwan.c
parent37357ca5a435258e6195051b8c336309ead5ea5e (diff)
downloadop-kernel-dev-3362c91c7841f2e4ab5b1f018a5da0ecbc924894.zip
op-kernel-dev-3362c91c7841f2e4ab5b1f018a5da0ecbc924894.tar.gz
USB: usb_wwan: clean up delayed-urb submission
Clean up and rename delay-urb submission function using a more descriptive name. Also add comment on locking assumptions. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/usb_wwan.c')
-rw-r--r--drivers/usb/serial/usb_wwan.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index b83aa60..45bc11b 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -602,7 +602,8 @@ int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
}
EXPORT_SYMBOL(usb_wwan_suspend);
-static int play_delayed(struct usb_serial_port *port)
+/* Caller must hold susp_lock. */
+static int usb_wwan_submit_delayed_urbs(struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
struct usb_wwan_intf_private *data = usb_get_serial_data(serial);
@@ -613,11 +614,14 @@ static int play_delayed(struct usb_serial_port *port)
portdata = usb_get_serial_port_data(port);
- while ((urb = usb_get_from_anchor(&portdata->delayed))) {
+ for (;;) {
+ urb = usb_get_from_anchor(&portdata->delayed);
+ if (!urb)
+ break;
+
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) {
- dev_err(&port->dev,
- "%s: submit write urb failed: %d\n",
+ dev_err(&port->dev, "%s: submit urb failed: %d\n",
__func__, err);
err_count++;
unbusy_queued_urb(urb, portdata);
@@ -664,7 +668,7 @@ int usb_wwan_resume(struct usb_serial *serial)
}
}
- err = play_delayed(port);
+ err = usb_wwan_submit_delayed_urbs(port);
if (err)
err_count++;
OpenPOWER on IntegriCloud