diff options
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 513b25e044c1..e8bc42f92e79 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -102,7 +102,7 @@ struct edgeport_port { | |||
102 | __u8 shadow_mcr; | 102 | __u8 shadow_mcr; |
103 | __u8 shadow_lsr; | 103 | __u8 shadow_lsr; |
104 | __u8 lsr_mask; | 104 | __u8 lsr_mask; |
105 | __u32 ump_read_timeout; /* Number of miliseconds the UMP will | 105 | __u32 ump_read_timeout; /* Number of milliseconds the UMP will |
106 | wait without data before completing | 106 | wait without data before completing |
107 | a read short */ | 107 | a read short */ |
108 | int baud_rate; | 108 | int baud_rate; |
@@ -2009,8 +2009,7 @@ release_es_lock: | |||
2009 | return status; | 2009 | return status; |
2010 | } | 2010 | } |
2011 | 2011 | ||
2012 | static void edge_close(struct tty_struct *tty, | 2012 | static void edge_close(struct usb_serial_port *port) |
2013 | struct usb_serial_port *port, struct file *filp) | ||
2014 | { | 2013 | { |
2015 | struct edgeport_serial *edge_serial; | 2014 | struct edgeport_serial *edge_serial; |
2016 | struct edgeport_port *edge_port; | 2015 | struct edgeport_port *edge_port; |
@@ -2664,7 +2663,7 @@ cleanup: | |||
2664 | return -ENOMEM; | 2663 | return -ENOMEM; |
2665 | } | 2664 | } |
2666 | 2665 | ||
2667 | static void edge_shutdown(struct usb_serial *serial) | 2666 | static void edge_disconnect(struct usb_serial *serial) |
2668 | { | 2667 | { |
2669 | int i; | 2668 | int i; |
2670 | struct edgeport_port *edge_port; | 2669 | struct edgeport_port *edge_port; |
@@ -2674,12 +2673,22 @@ static void edge_shutdown(struct usb_serial *serial) | |||
2674 | for (i = 0; i < serial->num_ports; ++i) { | 2673 | for (i = 0; i < serial->num_ports; ++i) { |
2675 | edge_port = usb_get_serial_port_data(serial->port[i]); | 2674 | edge_port = usb_get_serial_port_data(serial->port[i]); |
2676 | edge_remove_sysfs_attrs(edge_port->port); | 2675 | edge_remove_sysfs_attrs(edge_port->port); |
2676 | } | ||
2677 | } | ||
2678 | |||
2679 | static void edge_release(struct usb_serial *serial) | ||
2680 | { | ||
2681 | int i; | ||
2682 | struct edgeport_port *edge_port; | ||
2683 | |||
2684 | dbg("%s", __func__); | ||
2685 | |||
2686 | for (i = 0; i < serial->num_ports; ++i) { | ||
2687 | edge_port = usb_get_serial_port_data(serial->port[i]); | ||
2677 | edge_buf_free(edge_port->ep_out_buf); | 2688 | edge_buf_free(edge_port->ep_out_buf); |
2678 | kfree(edge_port); | 2689 | kfree(edge_port); |
2679 | usb_set_serial_port_data(serial->port[i], NULL); | ||
2680 | } | 2690 | } |
2681 | kfree(usb_get_serial_data(serial)); | 2691 | kfree(usb_get_serial_data(serial)); |
2682 | usb_set_serial_data(serial, NULL); | ||
2683 | } | 2692 | } |
2684 | 2693 | ||
2685 | 2694 | ||
@@ -2916,7 +2925,8 @@ static struct usb_serial_driver edgeport_1port_device = { | |||
2916 | .throttle = edge_throttle, | 2925 | .throttle = edge_throttle, |
2917 | .unthrottle = edge_unthrottle, | 2926 | .unthrottle = edge_unthrottle, |
2918 | .attach = edge_startup, | 2927 | .attach = edge_startup, |
2919 | .shutdown = edge_shutdown, | 2928 | .disconnect = edge_disconnect, |
2929 | .release = edge_release, | ||
2920 | .port_probe = edge_create_sysfs_attrs, | 2930 | .port_probe = edge_create_sysfs_attrs, |
2921 | .ioctl = edge_ioctl, | 2931 | .ioctl = edge_ioctl, |
2922 | .set_termios = edge_set_termios, | 2932 | .set_termios = edge_set_termios, |
@@ -2945,7 +2955,8 @@ static struct usb_serial_driver edgeport_2port_device = { | |||
2945 | .throttle = edge_throttle, | 2955 | .throttle = edge_throttle, |
2946 | .unthrottle = edge_unthrottle, | 2956 | .unthrottle = edge_unthrottle, |
2947 | .attach = edge_startup, | 2957 | .attach = edge_startup, |
2948 | .shutdown = edge_shutdown, | 2958 | .disconnect = edge_disconnect, |
2959 | .release = edge_release, | ||
2949 | .port_probe = edge_create_sysfs_attrs, | 2960 | .port_probe = edge_create_sysfs_attrs, |
2950 | .ioctl = edge_ioctl, | 2961 | .ioctl = edge_ioctl, |
2951 | .set_termios = edge_set_termios, | 2962 | .set_termios = edge_set_termios, |