Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133491
b: refs/heads/master
c: d1c0713
h: refs/heads/master
i:
  133489: 6e72723
  133487: 5f0c92c
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 24, 2009
1 parent a4d6375 commit 0838165
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4901b2c34ecb6fc45909228ad269c8126efe4401
refs/heads/master: d1c0713daea5d1d881ecc8707458ca6746031376
26 changes: 26 additions & 0 deletions trunk/drivers/usb/serial/opticon.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,37 @@ static void opticon_shutdown(struct usb_serial *serial)
usb_set_serial_data(serial, NULL);
}

static int opticon_suspend(struct usb_interface *intf, pm_message_t message)
{
struct usb_serial *serial = usb_get_intfdata(intf);
struct opticon_private *priv = usb_get_serial_data(serial);

usb_kill_urb(priv->bulk_read_urb);
return 0;
}

static int opticon_resume(struct usb_interface *intf)
{
struct usb_serial *serial = usb_get_intfdata(intf);
struct opticon_private *priv = usb_get_serial_data(serial);
struct usb_serial_port *port = serial->port[0];
int result;

mutex_lock(&port->mutex);
if (port->port.count)
result = usb_submit_urb(priv->bulk_read_urb, GFP_NOIO);
else
result = 0;
mutex_unlock(&port->mutex);
return result;
}

static struct usb_driver opticon_driver = {
.name = "opticon",
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.suspend = opticon_suspend,
.resume = opticon_resume,
.id_table = id_table,
.no_dynamic_id = 1,
};
Expand Down

0 comments on commit 0838165

Please sign in to comment.