Commit 3a90f818 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

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: default avatarOliver Neukum <oliver@neukum.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c1284d77
...@@ -163,7 +163,6 @@ struct usblp { ...@@ -163,7 +163,6 @@ struct usblp {
unsigned char used; /* True if open */ unsigned char used; /* True if open */
unsigned char present; /* True if not disconnected */ unsigned char present; /* True if not disconnected */
unsigned char bidir; /* interface is bidirectional */ unsigned char bidir; /* interface is bidirectional */
unsigned char sleeping; /* interface is suspended */
unsigned char no_paper; /* Paper Out happened */ unsigned char no_paper; /* Paper Out happened */
unsigned char *device_id_string; /* IEEE 1284 DEVICE ID string (ptr) */ unsigned char *device_id_string; /* IEEE 1284 DEVICE ID string (ptr) */
/* first 2 bytes are (big-endian) length */ /* first 2 bytes are (big-endian) length */
...@@ -191,7 +190,6 @@ static void usblp_dump(struct usblp *usblp) { ...@@ -191,7 +190,6 @@ static void usblp_dump(struct usblp *usblp) {
dbg("quirks=%d", usblp->quirks); dbg("quirks=%d", usblp->quirks);
dbg("used=%d", usblp->used); dbg("used=%d", usblp->used);
dbg("bidir=%d", usblp->bidir); dbg("bidir=%d", usblp->bidir);
dbg("sleeping=%d", usblp->sleeping);
dbg("device_id_string=\"%s\"", dbg("device_id_string=\"%s\"",
usblp->device_id_string ? usblp->device_id_string ?
usblp->device_id_string + 2 : usblp->device_id_string + 2 :
...@@ -376,7 +374,7 @@ static int usblp_check_status(struct usblp *usblp, int err) ...@@ -376,7 +374,7 @@ static int usblp_check_status(struct usblp *usblp, int err)
static int handle_bidir (struct usblp *usblp) static int handle_bidir (struct usblp *usblp)
{ {
if (usblp->bidir && usblp->used && !usblp->sleeping) { if (usblp->bidir && usblp->used) {
if (usblp_submit_read(usblp) < 0) if (usblp_submit_read(usblp) < 0)
return -EIO; return -EIO;
} }
...@@ -503,11 +501,6 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -503,11 +501,6 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto done; goto done;
} }
if (usblp->sleeping) {
retval = -ENODEV;
goto done;
}
dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd), dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd),
_IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) ); _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) );
...@@ -914,8 +907,6 @@ static int usblp_wtest(struct usblp *usblp, int nonblock) ...@@ -914,8 +907,6 @@ static int usblp_wtest(struct usblp *usblp, int nonblock)
return 0; return 0;
} }
spin_unlock_irqrestore(&usblp->lock, flags); spin_unlock_irqrestore(&usblp->lock, flags);
if (usblp->sleeping)
return -ENODEV;
if (nonblock) if (nonblock)
return -EAGAIN; return -EAGAIN;
return 1; return 1;
...@@ -968,8 +959,6 @@ static int usblp_rtest(struct usblp *usblp, int nonblock) ...@@ -968,8 +959,6 @@ static int usblp_rtest(struct usblp *usblp, int nonblock)
return 0; return 0;
} }
spin_unlock_irqrestore(&usblp->lock, flags); spin_unlock_irqrestore(&usblp->lock, flags);
if (usblp->sleeping)
return -ENODEV;
if (nonblock) if (nonblock)
return -EAGAIN; return -EAGAIN;
return 1; return 1;
...@@ -1377,12 +1366,10 @@ static void usblp_disconnect(struct usb_interface *intf) ...@@ -1377,12 +1366,10 @@ static void usblp_disconnect(struct usb_interface *intf)
mutex_unlock (&usblp_mutex); mutex_unlock (&usblp_mutex);
} }
static int usblp_suspend (struct usb_interface *intf, pm_message_t message) static int usblp_suspend(struct usb_interface *intf, pm_message_t message)
{ {
struct usblp *usblp = usb_get_intfdata (intf); struct usblp *usblp = usb_get_intfdata (intf);
/* we take no more IO */
usblp->sleeping = 1;
usblp_unlink_urbs(usblp); usblp_unlink_urbs(usblp);
#if 0 /* XXX Do we want this? What if someone is reading, should we fail? */ #if 0 /* XXX Do we want this? What if someone is reading, should we fail? */
/* not strictly necessary, but just in case */ /* not strictly necessary, but just in case */
...@@ -1393,12 +1380,11 @@ static int usblp_suspend (struct usb_interface *intf, pm_message_t message) ...@@ -1393,12 +1380,11 @@ static int usblp_suspend (struct usb_interface *intf, pm_message_t message)
return 0; return 0;
} }
static int usblp_resume (struct usb_interface *intf) static int usblp_resume(struct usb_interface *intf)
{ {
struct usblp *usblp = usb_get_intfdata (intf); struct usblp *usblp = usb_get_intfdata (intf);
int r; int r;
usblp->sleeping = 0;
r = handle_bidir (usblp); r = handle_bidir (usblp);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment