Commit 70f7aa08 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: remove magic number field from usb_serial_port as it's pretty useless.

parent 5e738ff1
...@@ -1117,7 +1117,6 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1117,7 +1117,6 @@ int usb_serial_probe(struct usb_interface *interface,
memset(port, 0x00, sizeof(struct usb_serial_port)); memset(port, 0x00, sizeof(struct usb_serial_port));
port->number = i + serial->minor; port->number = i + serial->minor;
port->serial = serial; port->serial = serial;
port->magic = USB_SERIAL_PORT_MAGIC;
INIT_WORK(&port->work, usb_serial_port_softint, port); INIT_WORK(&port->work, usb_serial_port_softint, port);
serial->port[i] = port; serial->port[i] = port;
} }
......
...@@ -63,14 +63,12 @@ ...@@ -63,14 +63,12 @@
#define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */ #define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */
#define USB_SERIAL_MAGIC 0x6702 /* magic number for usb_serial struct */ #define USB_SERIAL_MAGIC 0x6702 /* magic number for usb_serial struct */
#define USB_SERIAL_PORT_MAGIC 0x7301 /* magic number for usb_serial_port struct */
/* parity check flag */ /* parity check flag */
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
/** /**
* usb_serial_port: structure for the specific ports of a device. * usb_serial_port: structure for the specific ports of a device.
* @magic: magic number for internal validity of this pointer.
* @serial: pointer back to the struct usb_serial owner of this port. * @serial: pointer back to the struct usb_serial owner of this port.
* @tty: pointer to the corresponding tty for this port. * @tty: pointer to the corresponding tty for this port.
* @number: the number of the port (the minor number). * @number: the number of the port (the minor number).
...@@ -95,8 +93,7 @@ ...@@ -95,8 +93,7 @@
* ports of a device. * ports of a device.
*/ */
struct usb_serial_port { struct usb_serial_port {
int magic; struct usb_serial * serial;
struct usb_serial *serial;
struct tty_struct * tty; struct tty_struct * tty;
unsigned char number; unsigned char number;
...@@ -327,10 +324,6 @@ static inline int port_paranoia_check (struct usb_serial_port *port, const char ...@@ -327,10 +324,6 @@ static inline int port_paranoia_check (struct usb_serial_port *port, const char
dbg("%s - port == NULL", function); dbg("%s - port == NULL", function);
return -1; return -1;
} }
if (port->magic != USB_SERIAL_PORT_MAGIC) {
dbg("%s - bad magic number for port", function);
return -1;
}
if (!port->serial) { if (!port->serial) {
dbg("%s - port->serial == NULL", function); dbg("%s - port->serial == NULL", function);
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment