summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2020-09-01 14:03:29 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-04 17:14:47 +0200
commit5da6b1c079e6804a81e63ab8337224cbd2148c91 (patch)
tree4151586baf6dff1d07dab026d1a15e95ebfdbc18 /drivers/tty/serial
parentserial: core: Simplify with dev_err_probe() (diff)
downloadlinux-5da6b1c079e6804a81e63ab8337224cbd2148c91.tar.xz
linux-5da6b1c079e6804a81e63ab8337224cbd2148c91.zip
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. Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20200901120329.4176302-1-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/sc16is7xx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 809610b37c71..f86ec2d2635b 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1271,6 +1271,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;