diff options
author | Oliver Neukum <oliver@neukum.org> | 2009-12-27 18:52:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:39 -0500 |
commit | 3a90f81872b00a7526c2bb1ed7664fe5af727f39 (patch) | |
tree | e4c998177f53e374ceecb15fb549db654920d212 /drivers/usb | |
parent | c1284d7726c57c9d2bbc65cd08173fe7f9e637df (diff) |
USB: usblp: Remove checks no longer needed with the new runtime PM system
Under the new system a device cannot be suspended against
the driver's wish. Therefore this condition no longer needs
to be checked for.
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/usblp.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 9bc112ee7803..9d8ec729c263 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -163,7 +163,6 @@ struct usblp { | |||
163 | unsigned char used; /* True if open */ | 163 | unsigned char used; /* True if open */ |
164 | unsigned char present; /* True if not disconnected */ | 164 | unsigned char present; /* True if not disconnected */ |
165 | unsigned char bidir; /* interface is bidirectional */ | 165 | unsigned char bidir; /* interface is bidirectional */ |
166 | unsigned char sleeping; /* interface is suspended */ | ||
167 | unsigned char no_paper; /* Paper Out happened */ | 166 | unsigned char no_paper; /* Paper Out happened */ |
168 | unsigned char *device_id_string; /* IEEE 1284 DEVICE ID string (ptr) */ | 167 | unsigned char *device_id_string; /* IEEE 1284 DEVICE ID string (ptr) */ |
169 | /* first 2 bytes are (big-endian) length */ | 168 | /* first 2 bytes are (big-endian) length */ |
@@ -191,7 +190,6 @@ static void usblp_dump(struct usblp *usblp) { | |||
191 | dbg("quirks=%d", usblp->quirks); | 190 | dbg("quirks=%d", usblp->quirks); |
192 | dbg("used=%d", usblp->used); | 191 | dbg("used=%d", usblp->used); |
193 | dbg("bidir=%d", usblp->bidir); | 192 | dbg("bidir=%d", usblp->bidir); |
194 | dbg("sleeping=%d", usblp->sleeping); | ||
195 | dbg("device_id_string=\"%s\"", | 193 | dbg("device_id_string=\"%s\"", |
196 | usblp->device_id_string ? | 194 | usblp->device_id_string ? |
197 | usblp->device_id_string + 2 : | 195 | usblp->device_id_string + 2 : |
@@ -376,7 +374,7 @@ static int usblp_check_status(struct usblp *usblp, int err) | |||
376 | 374 | ||
377 | static int handle_bidir (struct usblp *usblp) | 375 | static int handle_bidir (struct usblp *usblp) |
378 | { | 376 | { |
379 | if (usblp->bidir && usblp->used && !usblp->sleeping) { | 377 | if (usblp->bidir && usblp->used) { |
380 | if (usblp_submit_read(usblp) < 0) | 378 | if (usblp_submit_read(usblp) < 0) |
381 | return -EIO; | 379 | return -EIO; |
382 | } | 380 | } |
@@ -503,11 +501,6 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
503 | goto done; | 501 | goto done; |
504 | } | 502 | } |
505 | 503 | ||
506 | if (usblp->sleeping) { | ||
507 | retval = -ENODEV; | ||
508 | goto done; | ||
509 | } | ||
510 | |||
511 | dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd), | 504 | dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd), |
512 | _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) ); | 505 | _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) ); |
513 | 506 | ||
@@ -914,8 +907,6 @@ static int usblp_wtest(struct usblp *usblp, int nonblock) | |||
914 | return 0; | 907 | return 0; |
915 | } | 908 | } |
916 | spin_unlock_irqrestore(&usblp->lock, flags); | 909 | spin_unlock_irqrestore(&usblp->lock, flags); |
917 | if (usblp->sleeping) | ||
918 | return -ENODEV; | ||
919 | if (nonblock) | 910 | if (nonblock) |
920 | return -EAGAIN; | 911 | return -EAGAIN; |
921 | return 1; | 912 | return 1; |
@@ -968,8 +959,6 @@ static int usblp_rtest(struct usblp *usblp, int nonblock) | |||
968 | return 0; | 959 | return 0; |
969 | } | 960 | } |
970 | spin_unlock_irqrestore(&usblp->lock, flags); | 961 | spin_unlock_irqrestore(&usblp->lock, flags); |
971 | if (usblp->sleeping) | ||
972 | return -ENODEV; | ||
973 | if (nonblock) | 962 | if (nonblock) |
974 | return -EAGAIN; | 963 | return -EAGAIN; |
975 | return 1; | 964 | return 1; |
@@ -1377,12 +1366,10 @@ static void usblp_disconnect(struct usb_interface *intf) | |||
1377 | mutex_unlock (&usblp_mutex); | 1366 | mutex_unlock (&usblp_mutex); |
1378 | } | 1367 | } |
1379 | 1368 | ||
1380 | static int usblp_suspend (struct usb_interface *intf, pm_message_t message) | 1369 | static int usblp_suspend(struct usb_interface *intf, pm_message_t message) |
1381 | { | 1370 | { |
1382 | struct usblp *usblp = usb_get_intfdata (intf); | 1371 | struct usblp *usblp = usb_get_intfdata (intf); |
1383 | 1372 | ||
1384 | /* we take no more IO */ | ||
1385 | usblp->sleeping = 1; | ||
1386 | usblp_unlink_urbs(usblp); | 1373 | usblp_unlink_urbs(usblp); |
1387 | #if 0 /* XXX Do we want this? What if someone is reading, should we fail? */ | 1374 | #if 0 /* XXX Do we want this? What if someone is reading, should we fail? */ |
1388 | /* not strictly necessary, but just in case */ | 1375 | /* not strictly necessary, but just in case */ |
@@ -1393,12 +1380,11 @@ static int usblp_suspend (struct usb_interface *intf, pm_message_t message) | |||
1393 | return 0; | 1380 | return 0; |
1394 | } | 1381 | } |
1395 | 1382 | ||
1396 | static int usblp_resume (struct usb_interface *intf) | 1383 | static int usblp_resume(struct usb_interface *intf) |
1397 | { | 1384 | { |
1398 | struct usblp *usblp = usb_get_intfdata (intf); | 1385 | struct usblp *usblp = usb_get_intfdata (intf); |
1399 | int r; | 1386 | int r; |
1400 | 1387 | ||
1401 | usblp->sleeping = 0; | ||
1402 | r = handle_bidir (usblp); | 1388 | r = handle_bidir (usblp); |
1403 | 1389 | ||
1404 | return r; | 1390 | return r; |