Thread (36 messages) 36 messages, 4 authors, 2022-06-30

Re: [PATCH 1/8] serial: core: only get RS485 termination gpio if supported

From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Date: 2022-06-23 02:00:08
Also in: linux-devicetree, linux-serial, lkml

Hi,

On 22.06.22 at 19:04, Andy Shevchenko wrote:
On Wed, Jun 22, 2022 at 05:46:52PM +0200, Lino Sanfilippo wrote:
quoted
From: Lino Sanfilippo <redacted>

In uart_get_rs485_mode() only try to get a termination GPIO if RS485 bus
termination is supported by the driver.
I'm not sure I got the usefulness of this change.
We request GPIO line as optional, so if one is defined it in the DT/ACPI, then
they probably want to (opportunistically) have it>

With your change it's possible to have a DTS where GPIO line defined in a
broken way and user won't ever know about it, if they are using platforms
without termination support.
This behavior is not introduced with this patch, also in the current code the driver
wont inform the user if it does not make use erroneous defined termination GPIO.

This patch at least prevents the driver from allocating and holding a GPIO descriptor across
the drivers lifetime that will never be used.

Furthermore it simplifies the code in patch 2 when we want to set the GPIO, since we can
skip the check whether or not the termination GPIO is supported by the driver.



Regards,
Lino


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help