All of lore.kernel.org
 help / color / mirror / Atom feed
* USB: serial: use tty_port_register_device()
@ 2018-05-16  9:42 Johan Hovold
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2018-05-16  9:42 UTC (permalink / raw)
  To: Johan Hovold; +Cc: Greg Kroah-Hartman, linux-usb

We already have the tty port when probing a usb-serial port so use
tty_port_register_device() directly instead of tty_port_install() later
to set up the port link.

This is a step towards enabling serdev for usb-serial (but we need to
determine how to handle hotplugging first).

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/bus.c        | 3 ++-
 drivers/usb/serial/usb-serial.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index 9e265eb92611..eb0195cf37dd 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -60,7 +60,8 @@ static int usb_serial_device_probe(struct device *dev)
 	}
 
 	minor = port->minor;
-	tty_dev = tty_register_device(usb_serial_tty_driver, minor, dev);
+	tty_dev = tty_port_register_device(&port->port, usb_serial_tty_driver,
+					   minor, dev);
 	if (IS_ERR(tty_dev)) {
 		retval = PTR_ERR(tty_dev);
 		goto err_port_remove;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 790e0cbe3da9..44ecf0e2be9d 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -192,7 +192,7 @@ static int serial_install(struct tty_driver *driver, struct tty_struct *tty)
 	if (retval)
 		goto error_get_interface;
 
-	retval = tty_port_install(&port->port, driver, tty);
+	retval = tty_standard_install(driver, tty);
 	if (retval)
 		goto error_init_termios;
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* USB: serial: use tty_port_register_device()
@ 2018-05-17  9:24 Johan Hovold
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2018-05-17  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Johan Hovold, linux-usb

On Wed, May 16, 2018 at 11:47:39AM +0200, Greg Kroah-Hartman wrote:
> On Wed, May 16, 2018 at 11:42:07AM +0200, Johan Hovold wrote:
> > We already have the tty port when probing a usb-serial port so use
> > tty_port_register_device() directly instead of tty_port_install() later
> > to set up the port link.
> > 
> > This is a step towards enabling serdev for usb-serial (but we need to
> > determine how to handle hotplugging first).
> > 
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thanks for reviewing. Now applied.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* USB: serial: use tty_port_register_device()
@ 2018-05-16  9:47 Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-05-16  9:47 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb

On Wed, May 16, 2018 at 11:42:07AM +0200, Johan Hovold wrote:
> We already have the tty port when probing a usb-serial port so use
> tty_port_register_device() directly instead of tty_port_install() later
> to set up the port link.
> 
> This is a step towards enabling serdev for usb-serial (but we need to
> determine how to handle hotplugging first).
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-17  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16  9:42 USB: serial: use tty_port_register_device() Johan Hovold
2018-05-16  9:47 Greg Kroah-Hartman
2018-05-17  9:24 Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.