diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-10 17:35:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-10 17:35:21 -0400 |
commit | d530296f63c039a5683db665acc5ecdb3b593eb2 (patch) | |
tree | 2656774d719545d9c0549dab8b13573125287ae7 /drivers/usb/serial | |
parent | 08dfa5c5323c81a960d77c3752bd6df235094ac3 (diff) |
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/serial')
-rw-r--r-- | drivers/usb/serial/opticon.c | 15 |
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) | |||
557 | kfree(priv); | 557 | kfree(priv); |
558 | } | 558 | } |
559 | 559 | ||
560 | static int opticon_suspend(struct usb_interface *intf, pm_message_t message) | 560 | static int opticon_suspend(struct usb_serial *serial, pm_message_t message) |
561 | { | 561 | { |
562 | struct usb_serial *serial = usb_get_intfdata(intf); | ||
563 | struct opticon_private *priv = usb_get_serial_data(serial); | 562 | struct opticon_private *priv = usb_get_serial_data(serial); |
564 | 563 | ||
565 | usb_kill_urb(priv->bulk_read_urb); | 564 | usb_kill_urb(priv->bulk_read_urb); |
566 | return 0; | 565 | return 0; |
567 | } | 566 | } |
568 | 567 | ||
569 | static int opticon_resume(struct usb_interface *intf) | 568 | static int opticon_resume(struct usb_serial *serial) |
570 | { | 569 | { |
571 | struct usb_serial *serial = usb_get_intfdata(intf); | ||
572 | struct opticon_private *priv = usb_get_serial_data(serial); | 570 | struct opticon_private *priv = usb_get_serial_data(serial); |
573 | struct usb_serial_port *port = serial->port[0]; | 571 | struct usb_serial_port *port = serial->port[0]; |
574 | int result; | 572 | int result; |
@@ -583,13 +581,6 @@ static int opticon_resume(struct usb_interface *intf) | |||
583 | return result; | 581 | return result; |
584 | } | 582 | } |
585 | 583 | ||
586 | static struct usb_driver opticon_driver = { | ||
587 | .name = "opticon", | ||
588 | .suspend = opticon_suspend, | ||
589 | .resume = opticon_resume, | ||
590 | .id_table = id_table, | ||
591 | }; | ||
592 | |||
593 | static struct usb_serial_driver opticon_device = { | 584 | static struct usb_serial_driver opticon_device = { |
594 | .driver = { | 585 | .driver = { |
595 | .owner = THIS_MODULE, | 586 | .owner = THIS_MODULE, |
@@ -609,6 +600,8 @@ static struct usb_serial_driver opticon_device = { | |||
609 | .ioctl = opticon_ioctl, | 600 | .ioctl = opticon_ioctl, |
610 | .tiocmget = opticon_tiocmget, | 601 | .tiocmget = opticon_tiocmget, |
611 | .tiocmset = opticon_tiocmset, | 602 | .tiocmset = opticon_tiocmset, |
603 | .suspend = opticon_suspend, | ||
604 | .resume = opticon_resume, | ||
612 | }; | 605 | }; |
613 | 606 | ||
614 | static struct usb_serial_driver * const serial_drivers[] = { | 607 | static struct usb_serial_driver * const serial_drivers[] = { |