Browse Source

USB: cdc-acm: do not update PM busy on read errors

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>
Johan Hovold 11 years ago
parent
commit
4a8ee5059a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/usb/class/cdc-acm.c

+ 3 - 1
drivers/usb/class/cdc-acm.c

@@ -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 */