mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] USB: serial: Support attaching serdev devices
@ 2026-09-17  8:11 Alban Bedel
  2026-09-17  8:27 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Alban Bedel @ 2026-09-17  8:11 UTC (permalink / raw)
  To: linux-kernel, linux-usb; +Cc: Greg Kroah-Hartman, Johan Hovold, Alban Bedel

Use tty_port_register_device_serdev() to allow attaching serdev
devices to USB serial ports. Also set the ACPI companion device on the
USB serial device to let the serdev matching work on ACPI systems.

Signed-off-by: Alban Bedel <alban.bedel@lht.dlh.de>
---
 drivers/usb/serial/bus.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index 9e2a18c0b2183..0b0a5ea1ba5aa 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/acpi.h>
 #include <linux/errno.h>
 #include <linux/tty.h>
 #include <linux/slab.h>
@@ -49,9 +50,13 @@ static int usb_serial_device_probe(struct device *dev)
 			goto err_autopm_put;
 	}
 
+	ACPI_COMPANION_SET(dev, ACPI_COMPANION(&port->serial->dev->dev));
+
 	minor = port->minor;
-	tty_dev = tty_port_register_device(&port->port, usb_serial_tty_driver,
-					   minor, dev);
+	tty_dev = tty_port_register_device_serdev(&port->port,
+						  usb_serial_tty_driver,
+						  minor, dev,
+						  &port->serial->dev->dev);
 	if (IS_ERR(tty_dev)) {
 		retval = PTR_ERR(tty_dev);
 		goto err_port_remove;
-- 
2.39.5


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

end of thread, other threads:[~2026-09-17 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17  8:11 [PATCH] USB: serial: Support attaching serdev devices Alban Bedel
2026-09-17  8:27 ` Greg Kroah-Hartman
2026-09-17 13:37   ` Alban Bedel
2026-09-17 14:08     ` Greg Kroah-Hartman
2026-09-17 15:21       ` Alban Bedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®