]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel-next.git/commitdiff
usb: gadget: u_serial: eliminate abuse of ep->driver data
authorRobert Baldyga <r.baldyga@samsung.com>
Thu, 25 Feb 2016 14:37:03 +0000 (20:07 +0530)
committerSekhar Nori <nsekhar@ti.com>
Fri, 26 Feb 2016 11:52:17 +0000 (17:22 +0530)
commit 18411c0f94716ec225a4f7e1d7735c80f5ec0dab upstream.

Since ep->driver_data is not used for endpoint claiming, neither for
enabled/disabled state storing, we can reduce number of places where
we read or modify it's value, as now it has no particular meaning for
function or framework logic.

In case of u_serial ep->driver_data stores pointer to struct gs_port,
which is referenced in many places in code. Code using ep->driver_data
to mark endpoint as enabled/disabled has been removed.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
drivers/usb/gadget/function/u_serial.c

index 7ee057930ae71793bcbd2777cb275572af21c295..9cc6a13d5e5b04893658b3ab83f507ab73c58658 100644 (file)
@@ -876,7 +876,6 @@ static void gs_close(struct tty_struct *tty, struct file *file)
        else
                gs_buf_clear(&port->port_write_buf);
 
-       tty->driver_data = NULL;
        port->port.tty = NULL;
 
        port->openclose = false;
@@ -1224,7 +1223,6 @@ int gserial_connect(struct gserial *gser, u8 port_num)
 
 fail_out:
        usb_ep_disable(gser->in);
-       gser->in->driver_data = NULL;
        return status;
 }
 EXPORT_SYMBOL_GPL(gserial_connect);
@@ -1264,10 +1262,7 @@ void gserial_disconnect(struct gserial *gser)
 
        /* disable endpoints, aborting down any active I/O */
        usb_ep_disable(gser->out);
-       gser->out->driver_data = NULL;
-
        usb_ep_disable(gser->in);
-       gser->in->driver_data = NULL;
 
        /* finally, free any unused/unusable I/O buffers */
        spin_lock_irqsave(&port->port_lock, flags);