From: Hugo Villeneuve Date: Mon, 7 Aug 2023 21:45:56 +0000 (-0400) Subject: serial: sc16is7xx: add missing support for rs485 devicetree properties X-Git-Tag: v6.1.68~251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8c1105c0ccceecf3e80ffc810a75dd4be5b7b7d;p=platform%2Fkernel%2Flinux-starfive.git serial: sc16is7xx: add missing support for rs485 devicetree properties commit b4a778303ea0fcabcaff974721477a5743e1f8ec upstream. Retrieve rs485 devicetree properties on registration of sc16is7xx ports in case they are attached to an rs485 transceiver. Signed-off-by: Hugo Villeneuve Reviewed-by: Ilpo Järvinen Reviewed-by: Lech Perczak Tested-by: Lech Perczak Link: https://lore.kernel.org/r/20230807214556.540627-7-hugo@hugovil.com Cc: Hugo Villeneuve Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 0ee3acf..b398fba 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1556,6 +1556,10 @@ static int sc16is7xx_probe(struct device *dev, goto out_ports; } + ret = uart_get_rs485_mode(&s->p[i].port); + if (ret) + goto out_ports; + /* Disable all interrupts */ sc16is7xx_port_write(&s->p[i].port, SC16IS7XX_IER_REG, 0); /* Disable TX/RX */