[PATCH 1/1] USB-SERIAL : Changing usb_serial_generic_open prototype

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While designing a usb to uart converter driver open function I am using
usb_serial_generic_open, but wouldn't find need to pass tty as an argument.
As it is not performing any task for further significance.
	So, This patch proposed a change in usb_serial_generic_open 
function prototype which has struct tty_struct as a first argument.

usb_serial_generic_open(struct tty_struct *tty, 
	struct usb_serial_port *port);

Signed-off-by: Abhishek Bist <ishubist@xxxxxxxxx>
---
 drivers/usb/serial/ark3116.c         | 2 +-
 drivers/usb/serial/belkin_sa.c       | 2 +-
 drivers/usb/serial/ch341.c           | 2 +-
 drivers/usb/serial/cp210x.c          | 2 +-
 drivers/usb/serial/f81232.c          | 2 +-
 drivers/usb/serial/ftdi_sio.c        | 2 +-
 drivers/usb/serial/generic.c         | 2 +-
 drivers/usb/serial/ipaq.c            | 2 +-
 drivers/usb/serial/ir-usb.c          | 2 +-
 drivers/usb/serial/kl5kusb105.c      | 2 +-
 drivers/usb/serial/omninet.c         | 2 +-
 drivers/usb/serial/opticon.c         | 2 +-
 drivers/usb/serial/pl2303.c          | 2 +-
 drivers/usb/serial/spcp8x5.c         | 2 +-
 drivers/usb/serial/ssu100.c          | 2 +-
 drivers/usb/serial/visor.c           | 2 +-
 drivers/usb/serial/whiteheat.c       | 2 +-
 drivers/usb/serial/wishbone-serial.c | 2 +-
 include/linux/usb/serial.h           | 3 +--
 19 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 1532cde..663297a 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -361,7 +361,7 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (buf == NULL)
 		return -ENOMEM;
 
-	result = usb_serial_generic_open(tty, port);
+	result = usb_serial_generic_open(port);
 	if (result) {
 		dev_dbg(&port->dev,
 			"%s - usb_serial_generic_open failed: %d\n",
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 15bc718..1925e1b 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -159,7 +159,7 @@ static int belkin_sa_open(struct tty_struct *tty,
 		return retval;
 	}
 
-	retval = usb_serial_generic_open(tty, port);
+	retval = usb_serial_generic_open(port);
 	if (retval)
 		usb_kill_urb(port->interrupt_in_urb);
 
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index c73808f..6893e65 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -328,7 +328,7 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
 		goto out;
 	}
 
-	r = usb_serial_generic_open(tty, port);
+	r = usb_serial_generic_open(port);
 
 out:	return r;
 }
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 84ce2d7..95fb901 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -467,7 +467,7 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (tty)
 		cp210x_change_speed(tty, port, NULL);
 
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 static void cp210x_close(struct usb_serial_port *port)
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 972f5a5..ad89623 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -549,7 +549,7 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
 		return result;
 	}
 
-	result = usb_serial_generic_open(tty, port);
+	result = usb_serial_generic_open(port);
 	if (result) {
 		usb_kill_urb(port->interrupt_in_urb);
 		return result;
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 8eb68a3..9079b61 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1947,7 +1947,7 @@ static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (tty)
 		ftdi_set_termios(tty, port, NULL);
 
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 static void ftdi_dtr_rts(struct usb_serial_port *port, int on)
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 54e170d..5917dea 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -77,7 +77,7 @@ void usb_serial_generic_deregister(void)
 #endif
 }
 
-int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port)
+int usb_serial_generic_open(struct usb_serial_port *port)
 {
 	int result = 0;
 	unsigned long flags;
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index f51a5d5..b0e50cf 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -546,7 +546,7 @@ static int ipaq_open(struct tty_struct *tty,
 		return result;
 	}
 
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 static int ipaq_calc_num_ports(struct usb_serial *serial)
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 73956d4..718c3ba 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -260,7 +260,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
 		port->write_urbs[i]->transfer_flags = URB_ZERO_PACKET;
 
 	/* Start reading from the device */
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 static int ir_prepare_write_buffer(struct usb_serial_port *port,
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index e020ad2..06e2606 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -293,7 +293,7 @@ static int  klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	/* READ_ON and urb submission */
-	rc = usb_serial_generic_open(tty, port);
+	rc = usb_serial_generic_open(port);
 	if (rc) {
 		retval = rc;
 		goto exit;
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index f6c6900..32146ac 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -135,7 +135,7 @@ static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port)
 	wport = serial->port[1];
 	tty_port_tty_set(&wport->port, tty);
 
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 #define OMNINET_HEADERLEN	4
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 4b7bfb3..e42a792 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -141,7 +141,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
 	/* clear the halt status of the endpoint */
 	usb_clear_halt(port->serial->dev, port->read_urb->pipe);
 
-	res = usb_serial_generic_open(tty, port);
+	res = usb_serial_generic_open(port);
 	if (!res)
 		return res;
 
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 829604d..1b81aac 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -645,7 +645,7 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
 		return result;
 	}
 
-	result = usb_serial_generic_open(tty, port);
+	result = usb_serial_generic_open(port);
 	if (result) {
 		usb_kill_urb(port->interrupt_in_urb);
 		return result;
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index ef0dbf0..51eb234 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -409,7 +409,7 @@ static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (tty)
 		spcp8x5_set_termios(tty, port, NULL);
 
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 static int spcp8x5_tiocmset(struct tty_struct *tty,
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 70a098d..bc04ea3 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -310,7 +310,7 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (tty)
 		ssu100_set_termios(tty, port, &tty->termios);
 
-	return usb_serial_generic_open(tty, port);
+	return usb_serial_generic_open(port);
 }
 
 static int get_serial_info(struct usb_serial_port *port,
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index bf2bd40..4ce5631 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -235,7 +235,7 @@ static int visor_open(struct tty_struct *tty, struct usb_serial_port *port)
 	}
 
 	/* Start reading from the device */
-	result = usb_serial_generic_open(tty, port);
+	result = usb_serial_generic_open(port);
 	if (result)
 		goto exit;
 
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 6c3734d..139e24d 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -385,7 +385,7 @@ static int whiteheat_open(struct tty_struct *tty, struct usb_serial_port *port)
 	usb_clear_halt(port->serial->dev, port->read_urb->pipe);
 	usb_clear_halt(port->serial->dev, port->write_urb->pipe);
 
-	retval = usb_serial_generic_open(tty, port);
+	retval = usb_serial_generic_open(port);
 	if (retval) {
 		firm_close(port);
 		stop_command_port(port->serial);
diff --git a/drivers/usb/serial/wishbone-serial.c b/drivers/usb/serial/wishbone-serial.c
index 4fed4a0..07b1ba1 100644
--- a/drivers/usb/serial/wishbone-serial.c
+++ b/drivers/usb/serial/wishbone-serial.c
@@ -59,7 +59,7 @@ static int wishbone_serial_open(struct tty_struct *tty,
 		return retval;
 	}
 
-	retval = usb_serial_generic_open(tty, port);
+	retval = usb_serial_generic_open(port);
 	if (retval)
 		usb_gsi_openclose(port, 0);
 
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 704a1ab..c8ed44a 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -318,8 +318,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
 /* Functions needed by other parts of the usbserial core */
 extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor);
 extern void usb_serial_put(struct usb_serial *serial);
-extern int usb_serial_generic_open(struct tty_struct *tty,
-	struct usb_serial_port *port);
+extern int usb_serial_generic_open(struct usb_serial_port *port);
 extern int usb_serial_generic_write_start(struct usb_serial_port *port,
 							gfp_t mem_flags);
 extern int usb_serial_generic_write(struct tty_struct *tty,
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux