ChangeSet 1.946.3.16, 2002/12/26 18:24:39-08:00, greg@kroah.com

[PATCH] USB: add usb_get_serial_data() and usb_set_serial_data() functions.

This is to access the private pointer in struct usb_serial


diff -Nru a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
--- a/drivers/usb/serial/usb-serial.h	Fri Dec 27 23:57:06 2002
+++ b/drivers/usb/serial/usb-serial.h	Fri Dec 27 23:57:06 2002
@@ -148,7 +148,8 @@
  * @port: array of struct usb_serial_port structures for the different ports.
  * @private: place to put any driver specific information that is needed.  The
  *	usb-serial driver is required to manage this data, the usb-serial core
- *	will not touch this.
+ *	will not touch this.  Use usb_get_serial_data() and
+ *	usb_set_serial_data() to access this.
  */
 struct usb_serial {
 	int				magic;
@@ -166,9 +167,18 @@
 	void *				private;
 };
 
-
 #define NUM_DONT_CARE	(-1)
 
+/* get and set the serial private data pointer helper functions */
+static inline void *usb_get_serial_data (struct usb_serial *serial)
+{
+	return serial->private;
+}
+
+static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
+{
+	serial->private = data;
+}
 
 /**
  * usb_serial_device_type - a structure that defines a usb serial device
