aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2007-08-14 01:54:29 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:14 -0400
commit283face86b002e670053e9189604852ccb81d357 (patch)
treeffcf978065ffe3b7cf550c44afa4c571b028b2be /drivers/usb/class
parentfc401e697f8c00ad1178a6758e86e3881dfa3181 (diff)
usblp: Cosmetics
This is a small bunch of cosmetic fixes: - Timeout is not a write timeout anymore, rename - Condition in poll was confusingly backwards, invert and simplify - The comment log gave a wrong impression of version 0.13, terminate it. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/usblp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 2c4a359355ba..3a0f8186d4bf 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -28,6 +28,7 @@
28 * v0.12 - add hpoj.sourceforge.net ioctls (David Paschal) 28 * v0.12 - add hpoj.sourceforge.net ioctls (David Paschal)
29 * v0.13 - alloc space for statusbuf (<status> not on stack); 29 * v0.13 - alloc space for statusbuf (<status> not on stack);
30 * use usb_buffer_alloc() for read buf & write buf; 30 * use usb_buffer_alloc() for read buf & write buf;
31 * none - Maintained in Linux kernel after v0.13
31 */ 32 */
32 33
33/* 34/*
@@ -114,7 +115,7 @@ MFG:HEWLETT-PACKARD;MDL:DESKJET 970C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:H
114#define USBLP_MINORS 16 115#define USBLP_MINORS 16
115#define USBLP_MINOR_BASE 0 116#define USBLP_MINOR_BASE 0
116 117
117#define USBLP_WRITE_TIMEOUT (5000) /* 5 seconds */ 118#define USBLP_CTL_TIMEOUT 5000 /* 5 seconds */
118 119
119#define USBLP_FIRST_PROTOCOL 1 120#define USBLP_FIRST_PROTOCOL 1
120#define USBLP_LAST_PROTOCOL 3 121#define USBLP_LAST_PROTOCOL 3
@@ -260,7 +261,7 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i
260 261
261 retval = usb_control_msg(usblp->dev, 262 retval = usb_control_msg(usblp->dev,
262 dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0), 263 dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0),
263 request, type | dir | recip, value, index, buf, len, USBLP_WRITE_TIMEOUT); 264 request, type | dir | recip, value, index, buf, len, USBLP_CTL_TIMEOUT);
264 dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d", 265 dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d",
265 request, !!dir, recip, value, index, len, retval); 266 request, !!dir, recip, value, index, len, retval);
266 return retval < 0 ? retval : 0; 267 return retval < 0 ? retval : 0;
@@ -479,8 +480,8 @@ static unsigned int usblp_poll(struct file *file, struct poll_table_struct *wait
479 poll_wait(file, &usblp->rwait, wait); 480 poll_wait(file, &usblp->rwait, wait);
480 poll_wait(file, &usblp->wwait, wait); 481 poll_wait(file, &usblp->wwait, wait);
481 spin_lock_irqsave(&usblp->lock, flags); 482 spin_lock_irqsave(&usblp->lock, flags);
482 ret = ((!usblp->bidir || !usblp->rcomplete) ? 0 : POLLIN | POLLRDNORM) 483 ret = ((usblp->bidir && usblp->rcomplete) ? POLLIN | POLLRDNORM : 0) |
483 | ((usblp->no_paper || usblp->wcomplete) ? POLLOUT | POLLWRNORM : 0); 484 ((usblp->no_paper || usblp->wcomplete) ? POLLOUT | POLLWRNORM : 0);
484 spin_unlock_irqrestore(&usblp->lock, flags); 485 spin_unlock_irqrestore(&usblp->lock, flags);
485 return ret; 486 return ret;
486} 487}