summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-12-01 10:01:08 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-08 11:17:31 -0800
commitf10f9dd87161b70da6ec3d257c1f01a6ac02536f (patch)
tree89c067a2f1afc755bc2fdd8fb5e9a6a45fabf04f /include
parente1897f9fc227055733cea2b7449af38276b2e6a5 (diff)
downloadlinux-stable-f10f9dd87161b70da6ec3d257c1f01a6ac02536f.tar.gz
linux-stable-f10f9dd87161b70da6ec3d257c1f01a6ac02536f.tar.bz2
linux-stable-f10f9dd87161b70da6ec3d257c1f01a6ac02536f.zip
USB: usb-serial: replace shutdown with disconnect, release
This is commit f9c99bb8b3a1ec81af68d484a551307326c2e933 back-ported to 2.6.27.39. This patch (as1254-2) splits up the shutdown method of usb_serial_driver into a disconnect and a release method. The problem is that the usb-serial core was calling shutdown during disconnect handling, but drivers didn't expect it to be called until after all the open file references had been closed. The result was an oops when the close method tried to use memory that had been deallocated by shutdown. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Rory Filer <rfiler@SierraWireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/serial.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 655341d0f534..9d8ca874bb0f 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -177,8 +177,10 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data)
* This will be called when the struct usb_serial structure is fully set
* set up. Do any local initialization of the device, or any private
* memory structure allocation at this point in time.
- * @shutdown: pointer to the driver's shutdown function. This will be
- * called when the device is removed from the system.
+ * @disconnect: pointer to the driver's disconnect function. This will be
+ * called when the device is unplugged or unbound from the driver.
+ * @release: pointer to the driver's release function. This will be called
+ * when the usb_serial data structure is about to be destroyed.
* @usb_driver: pointer to the struct usb_driver that controls this
* device. This is necessary to allow dynamic ids to be added to
* the driver from sysfs.
@@ -208,7 +210,8 @@ struct usb_serial_driver {
int (*attach)(struct usb_serial *serial);
int (*calc_num_ports) (struct usb_serial *serial);
- void (*shutdown)(struct usb_serial *serial);
+ void (*disconnect)(struct usb_serial *serial);
+ void (*release)(struct usb_serial *serial);
int (*port_probe)(struct usb_serial_port *port);
int (*port_remove)(struct usb_serial_port *port);
@@ -288,7 +291,8 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb);
extern void usb_serial_generic_write_bulk_callback(struct urb *urb);
extern void usb_serial_generic_throttle(struct tty_struct *tty);
extern void usb_serial_generic_unthrottle(struct tty_struct *tty);
-extern void usb_serial_generic_shutdown(struct usb_serial *serial);
+extern void usb_serial_generic_disconnect(struct usb_serial *serial);
+extern void usb_serial_generic_release(struct usb_serial *serial);
extern int usb_serial_generic_register(int debug);
extern void usb_serial_generic_deregister(void);