Skip to contentSkip to conversation

sc16is7xx: Set iobase to device index

PATCH New Daniel Mack 1 participant 1 message Sep 1, 2020 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sc16is7xx: Set iobase to device index

Some derivates of sc16is7xx devices expose more than one tty device to userspace. If multiple such devices exist in a system, userspace currently has no clean way to infer which tty maps to which physical line.

Set the .iobase value to the relative index within the device to allow infering the order through sysfs.

---
 drivers/tty/serial/sc16is7xx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/sc16is7xx.c +1 -0
index d2e5c6c866439..a3085b90e2023 100644
@@ -1272,6 +1272,7 @@ static int sc16is7xx_probe(struct device *dev,
 		s->p[i].port.type	= PORT_SC16IS7XX;
 		s->p[i].port.fifosize	= SC16IS7XX_FIFO_SIZE;
 		s->p[i].port.flags	= UPF_FIXED_TYPE | UPF_LOW_LATENCY;
+		s->p[i].port.iobase	= i;
 		s->p[i].port.iotype	= UPIO_PORT;
 		s->p[i].port.uartclk	= freq;
 		s->p[i].port.rs485_config = sc16is7xx_config_rs485;
Signature · 1 line
2.26.2