aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/usblp.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-07-18 13:58:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-19 20:46:06 -0400
commit18ac3016055b58d676f6148a77dcf539d05ce215 (patch)
tree650f9a5f2f5832248cf101dbc808343ac5a03586 /drivers/usb/class/usblp.c
parent185d40587d22fe604962fb53c0c9a9f1670feb66 (diff)
USB: class: usblp: clean up urb->status usage
This done in anticipation of removal of urb->status, which will make that patch easier to review and apply in the future. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/usblp.c')
-rw-r--r--drivers/usb/class/usblp.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 80ec1039d670..5192cd9356de 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -289,16 +289,17 @@ static int proto_bias = -1;
289static void usblp_bulk_read(struct urb *urb) 289static void usblp_bulk_read(struct urb *urb)
290{ 290{
291 struct usblp *usblp = urb->context; 291 struct usblp *usblp = urb->context;
292 int status = urb->status;
292 293
293 if (usblp->present && usblp->used) { 294 if (usblp->present && usblp->used) {
294 if (urb->status) 295 if (status)
295 printk(KERN_WARNING "usblp%d: " 296 printk(KERN_WARNING "usblp%d: "
296 "nonzero read bulk status received: %d\n", 297 "nonzero read bulk status received: %d\n",
297 usblp->minor, urb->status); 298 usblp->minor, status);
298 } 299 }
299 spin_lock(&usblp->lock); 300 spin_lock(&usblp->lock);
300 if (urb->status < 0) 301 if (status < 0)
301 usblp->rstatus = urb->status; 302 usblp->rstatus = status;
302 else 303 else
303 usblp->rstatus = urb->actual_length; 304 usblp->rstatus = urb->actual_length;
304 usblp->rcomplete = 1; 305 usblp->rcomplete = 1;
@@ -311,16 +312,17 @@ static void usblp_bulk_read(struct urb *urb)
311static void usblp_bulk_write(struct urb *urb) 312static void usblp_bulk_write(struct urb *urb)
312{ 313{
313 struct usblp *usblp = urb->context; 314 struct usblp *usblp = urb->context;
315 int status = urb->status;
314 316
315 if (usblp->present && usblp->used) { 317 if (usblp->present && usblp->used) {
316 if (urb->status) 318 if (status)
317 printk(KERN_WARNING "usblp%d: " 319 printk(KERN_WARNING "usblp%d: "
318 "nonzero write bulk status received: %d\n", 320 "nonzero write bulk status received: %d\n",
319 usblp->minor, urb->status); 321 usblp->minor, status);
320 } 322 }
321 spin_lock(&usblp->lock); 323 spin_lock(&usblp->lock);
322 if (urb->status < 0) 324 if (status < 0)
323 usblp->wstatus = urb->status; 325 usblp->wstatus = status;
324 else 326 else
325 usblp->wstatus = urb->actual_length; 327 usblp->wstatus = urb->actual_length;
326 usblp->wcomplete = 1; 328 usblp->wcomplete = 1;