summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 23:35:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 23:35:21 +0200
commitd530296f63c039a5683db665acc5ecdb3b593eb2 (patch)
tree2656774d719545d9c0549dab8b13573125287ae7 /drivers/usb
parentUSB: serqt_usb2: remove duplicate device ids (diff)
downloadlinux-d530296f63c039a5683db665acc5ecdb3b593eb2.tar.xz
linux-d530296f63c039a5683db665acc5ecdb3b593eb2.zip
USB: serial: opticon: hook up suspend/resume callbacks
With a previous patch, the usb_driver suspend/resume callbacks got overridden and were never called if a usb_serial driver defined them. This patch fixes the opticon driver to move the suspend/resume callbacks into the usb_serial_driver structure where they will be properly called. It then removes the unused usb_driver structure. Cc: Johan Hovold <jhovold@gmail.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: Julia Lawall <julia@diku.dk> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/opticon.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 91f89044e08d..02cb1b7f6559 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -557,18 +557,16 @@ static void opticon_release(struct usb_serial *serial)
kfree(priv);
}
-static int opticon_suspend(struct usb_interface *intf, pm_message_t message)
+static int opticon_suspend(struct usb_serial *serial, 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)
+static int opticon_resume(struct usb_serial *serial)
{
- 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;
@@ -583,13 +581,6 @@ static int opticon_resume(struct usb_interface *intf)
return result;
}
-static struct usb_driver opticon_driver = {
- .name = "opticon",
- .suspend = opticon_suspend,
- .resume = opticon_resume,
- .id_table = id_table,
-};
-
static struct usb_serial_driver opticon_device = {
.driver = {
.owner = THIS_MODULE,
@@ -609,6 +600,8 @@ static struct usb_serial_driver opticon_device = {
.ioctl = opticon_ioctl,
.tiocmget = opticon_tiocmget,
.tiocmset = opticon_tiocmset,
+ .suspend = opticon_suspend,
+ .resume = opticon_resume,
};
static struct usb_serial_driver * const serial_drivers[] = {