aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-11-18 07:23:24 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-21 16:33:54 -0500
commit3157fad9ad6dbc97ee0ba2d6ada256370841c77a (patch)
treefd16ec9d70385908221d265bedc8b4865b9d1151
parente29a7738c531ba33a70cbf78809fb3dc5a0a42db (diff)
USB: opticon: remove private serial-device data
Remove usb-serial-device field from private data as it can be accessed from the usb-serial-port structure. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/serial/opticon.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index bcb8ad84a74a..f81ffb019314 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -40,7 +40,6 @@ MODULE_DEVICE_TABLE(usb, id_table);
40 40
41/* This structure holds all of the individual device information */ 41/* This structure holds all of the individual device information */
42struct opticon_private { 42struct opticon_private {
43 struct usb_device *udev;
44 struct usb_serial *serial; 43 struct usb_serial *serial;
45 struct usb_serial_port *port; 44 struct usb_serial_port *port;
46 unsigned char *bulk_in_buffer; 45 unsigned char *bulk_in_buffer;
@@ -185,7 +184,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
185 send_control_msg(port, CONTROL_RTS, 0); 184 send_control_msg(port, CONTROL_RTS, 0);
186 185
187 /* clear the halt status of the enpoint */ 186 /* clear the halt status of the enpoint */
188 usb_clear_halt(priv->udev, priv->bulk_read_urb->pipe); 187 usb_clear_halt(port->serial->dev, priv->bulk_read_urb->pipe);
189 188
190 result = usb_submit_urb(priv->bulk_read_urb, GFP_KERNEL); 189 result = usb_submit_urb(priv->bulk_read_urb, GFP_KERNEL);
191 if (result) 190 if (result)
@@ -487,7 +486,6 @@ static int opticon_startup(struct usb_serial *serial)
487 spin_lock_init(&priv->lock); 486 spin_lock_init(&priv->lock);
488 priv->serial = serial; 487 priv->serial = serial;
489 priv->port = serial->port[0]; 488 priv->port = serial->port[0];
490 priv->udev = serial->dev;
491 priv->outstanding_urbs = 0; /* Init the outstanding urbs */ 489 priv->outstanding_urbs = 0; /* Init the outstanding urbs */
492 490
493 /* find our bulk endpoint */ 491 /* find our bulk endpoint */
@@ -501,14 +499,14 @@ static int opticon_startup(struct usb_serial *serial)
501 499
502 priv->bulk_read_urb = usb_alloc_urb(0, GFP_KERNEL); 500 priv->bulk_read_urb = usb_alloc_urb(0, GFP_KERNEL);
503 if (!priv->bulk_read_urb) { 501 if (!priv->bulk_read_urb) {
504 dev_err(&priv->udev->dev, "out of memory\n"); 502 dev_err(&serial->dev->dev, "out of memory\n");
505 goto error; 503 goto error;
506 } 504 }
507 505
508 priv->buffer_size = usb_endpoint_maxp(endpoint) * 2; 506 priv->buffer_size = usb_endpoint_maxp(endpoint) * 2;
509 priv->bulk_in_buffer = kmalloc(priv->buffer_size, GFP_KERNEL); 507 priv->bulk_in_buffer = kmalloc(priv->buffer_size, GFP_KERNEL);
510 if (!priv->bulk_in_buffer) { 508 if (!priv->bulk_in_buffer) {
511 dev_err(&priv->udev->dev, "out of memory\n"); 509 dev_err(&serial->dev->dev, "out of memory\n");
512 goto error; 510 goto error;
513 } 511 }
514 512
@@ -519,7 +517,7 @@ static int opticon_startup(struct usb_serial *serial)
519 } 517 }
520 518
521 if (!bulk_in_found) { 519 if (!bulk_in_found) {
522 dev_err(&priv->udev->dev, 520 dev_err(&serial->dev->dev,
523 "Error - the proper endpoints were not found!\n"); 521 "Error - the proper endpoints were not found!\n");
524 goto error; 522 goto error;
525 } 523 }