USB: cdc-acm: do not update PM busy on read errors
authorJohan Hovold <jhovold@gmail.com>
Mon, 26 May 2014 17:23:49 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 22:04:10 +0000 (15:04 -0700)
There's no need to update the runtime PM last_busy field on read urb
errors (e.g. when the urb is being killed on shutdown).

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c

index f038f390db9746962363c683ec0c15369cb4792e..3c7cfac48e3020732d2d02a2516393f1e654857c 100644 (file)
@@ -416,13 +416,15 @@ static void acm_read_bulk_callback(struct urb *urb)
                dev_dbg(&acm->data->dev, "%s - disconnected\n", __func__);
                return;
        }
-       usb_mark_last_busy(acm->dev);
 
        if (urb->status) {
                dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n",
                                                        __func__, urb->status);
                return;
        }
+
+       usb_mark_last_busy(acm->dev);
+
        acm_process_read_urb(acm, urb);
 
        /* throttle device if requested by tty */