diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/keyspan_pda.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index ca43ecb4a2bd..bb87e29c4ac2 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
@@ -713,29 +713,33 @@ MODULE_FIRMWARE("keyspan_pda/keyspan_pda.fw"); | |||
713 | MODULE_FIRMWARE("keyspan_pda/xircom_pgs.fw"); | 713 | MODULE_FIRMWARE("keyspan_pda/xircom_pgs.fw"); |
714 | #endif | 714 | #endif |
715 | 715 | ||
716 | static int keyspan_pda_startup(struct usb_serial *serial) | 716 | static int keyspan_pda_port_probe(struct usb_serial_port *port) |
717 | { | 717 | { |
718 | 718 | ||
719 | struct keyspan_pda_private *priv; | 719 | struct keyspan_pda_private *priv; |
720 | 720 | ||
721 | /* allocate the private data structures for all ports. Well, for all | ||
722 | one ports. */ | ||
723 | |||
724 | priv = kmalloc(sizeof(struct keyspan_pda_private), GFP_KERNEL); | 721 | priv = kmalloc(sizeof(struct keyspan_pda_private), GFP_KERNEL); |
725 | if (!priv) | 722 | if (!priv) |
726 | return 1; /* error */ | 723 | return -ENOMEM; |
727 | usb_set_serial_port_data(serial->port[0], priv); | 724 | |
728 | init_waitqueue_head(&serial->port[0]->write_wait); | ||
729 | INIT_WORK(&priv->wakeup_work, keyspan_pda_wakeup_write); | 725 | INIT_WORK(&priv->wakeup_work, keyspan_pda_wakeup_write); |
730 | INIT_WORK(&priv->unthrottle_work, keyspan_pda_request_unthrottle); | 726 | INIT_WORK(&priv->unthrottle_work, keyspan_pda_request_unthrottle); |
731 | priv->serial = serial; | 727 | priv->serial = port->serial; |
732 | priv->port = serial->port[0]; | 728 | priv->port = port; |
729 | |||
730 | usb_set_serial_port_data(port, priv); | ||
731 | |||
733 | return 0; | 732 | return 0; |
734 | } | 733 | } |
735 | 734 | ||
736 | static void keyspan_pda_release(struct usb_serial *serial) | 735 | static int keyspan_pda_port_remove(struct usb_serial_port *port) |
737 | { | 736 | { |
738 | kfree(usb_get_serial_port_data(serial->port[0])); | 737 | struct keyspan_pda_private *priv; |
738 | |||
739 | priv = usb_get_serial_port_data(port); | ||
740 | kfree(priv); | ||
741 | |||
742 | return 0; | ||
739 | } | 743 | } |
740 | 744 | ||
741 | #ifdef KEYSPAN | 745 | #ifdef KEYSPAN |
@@ -786,8 +790,8 @@ static struct usb_serial_driver keyspan_pda_device = { | |||
786 | .break_ctl = keyspan_pda_break_ctl, | 790 | .break_ctl = keyspan_pda_break_ctl, |
787 | .tiocmget = keyspan_pda_tiocmget, | 791 | .tiocmget = keyspan_pda_tiocmget, |
788 | .tiocmset = keyspan_pda_tiocmset, | 792 | .tiocmset = keyspan_pda_tiocmset, |
789 | .attach = keyspan_pda_startup, | 793 | .port_probe = keyspan_pda_port_probe, |
790 | .release = keyspan_pda_release, | 794 | .port_remove = keyspan_pda_port_remove, |
791 | }; | 795 | }; |
792 | 796 | ||
793 | static struct usb_serial_driver * const serial_drivers[] = { | 797 | static struct usb_serial_driver * const serial_drivers[] = { |