diff options
Diffstat (limited to 'drivers/usb/serial/kobil_sct.c')
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 5c4d2fbd4e11..c9ca7a5b12e0 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -54,8 +54,8 @@ | |||
54 | 54 | ||
55 | 55 | ||
56 | /* Function prototypes */ | 56 | /* Function prototypes */ |
57 | static int kobil_startup(struct usb_serial *serial); | 57 | static int kobil_port_probe(struct usb_serial_port *probe); |
58 | static void kobil_release(struct usb_serial *serial); | 58 | static int kobil_port_remove(struct usb_serial_port *probe); |
59 | static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port); | 59 | static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port); |
60 | static void kobil_close(struct usb_serial_port *port); | 60 | static void kobil_close(struct usb_serial_port *port); |
61 | static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, | 61 | static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, |
@@ -89,8 +89,8 @@ static struct usb_serial_driver kobil_device = { | |||
89 | .description = "KOBIL USB smart card terminal", | 89 | .description = "KOBIL USB smart card terminal", |
90 | .id_table = id_table, | 90 | .id_table = id_table, |
91 | .num_ports = 1, | 91 | .num_ports = 1, |
92 | .attach = kobil_startup, | 92 | .port_probe = kobil_port_probe, |
93 | .release = kobil_release, | 93 | .port_remove = kobil_port_remove, |
94 | .ioctl = kobil_ioctl, | 94 | .ioctl = kobil_ioctl, |
95 | .set_termios = kobil_set_termios, | 95 | .set_termios = kobil_set_termios, |
96 | .init_termios = kobil_init_termios, | 96 | .init_termios = kobil_init_termios, |
@@ -117,9 +117,10 @@ struct kobil_private { | |||
117 | }; | 117 | }; |
118 | 118 | ||
119 | 119 | ||
120 | static int kobil_startup(struct usb_serial *serial) | 120 | static int kobil_port_probe(struct usb_serial_port *port) |
121 | { | 121 | { |
122 | int i; | 122 | int i; |
123 | struct usb_serial *serial = port->serial; | ||
123 | struct kobil_private *priv; | 124 | struct kobil_private *priv; |
124 | struct usb_device *pdev; | 125 | struct usb_device *pdev; |
125 | struct usb_host_config *actconfig; | 126 | struct usb_host_config *actconfig; |
@@ -149,7 +150,7 @@ static int kobil_startup(struct usb_serial *serial) | |||
149 | dev_dbg(&serial->dev->dev, "KOBIL KAAN SIM detected\n"); | 150 | dev_dbg(&serial->dev->dev, "KOBIL KAAN SIM detected\n"); |
150 | break; | 151 | break; |
151 | } | 152 | } |
152 | usb_set_serial_port_data(serial->port[0], priv); | 153 | usb_set_serial_port_data(port, priv); |
153 | 154 | ||
154 | /* search for the necessary endpoints */ | 155 | /* search for the necessary endpoints */ |
155 | pdev = serial->dev; | 156 | pdev = serial->dev; |
@@ -179,12 +180,14 @@ static int kobil_startup(struct usb_serial *serial) | |||
179 | } | 180 | } |
180 | 181 | ||
181 | 182 | ||
182 | static void kobil_release(struct usb_serial *serial) | 183 | static int kobil_port_remove(struct usb_serial_port *port) |
183 | { | 184 | { |
184 | int i; | 185 | struct kobil_private *priv; |
185 | 186 | ||
186 | for (i = 0; i < serial->num_ports; ++i) | 187 | priv = usb_get_serial_port_data(port); |
187 | kfree(usb_get_serial_port_data(serial->port[i])); | 188 | kfree(priv); |
189 | |||
190 | return 0; | ||
188 | } | 191 | } |
189 | 192 | ||
190 | static void kobil_init_termios(struct tty_struct *tty) | 193 | static void kobil_init_termios(struct tty_struct *tty) |