Re: [PATCH 1/5] serial: Make retrieval of rs485 properties platform-agnostic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 08, 2017 at 11:32:34AM +0100, Lukas Wunner wrote:
> Commit ef838a81dd4d ("serial: Add common rs485 device tree parsing
> function") consolidated retrieval of rs485 OF properties in a common
> helper function but did not #ifdef it to CONFIG_OF.  The function is
> therefore included on ACPI platforms as well even though it's not used.
> 
> On the other hand ACPI platforms with rs485 do exist (e.g. Siemens
> IOT2040) and they may leverage _DSD to store rs485 properties.  Likewise,
> UART platform devices instantiated from an MFD should be able to specify
> rs485 properties.  In fact, the tty subsystem maintainer had requested
> a "generic" function during review of commit ef838a81dd4d:
> https://marc.info/?l=linux-serial&m=150143441725194&w=4

I wouldn't write "had requested", it was more "asked for" IMHO.

> Thus, instead of constraining the helper to OF platforms, make it
> platform-agnostic by converting it to device_property_*() functions
> and renaming it accordingly.
> 
> In imx.c, move the invocation of uart_get_rs485_mode() from
> serial_imx_probe_dt() to serial_imx_probe() so that it also gets called
> for non-OF devices.
> 
> In omap-serial.c, move its invocation further up within
> serial_omap_probe_rs485() so that the RTS polarity can be overridden
> with the driver-specific "rs485-rts-active-high" property once we
> introduce a generic "rs485-rts-active-low" property.
>
> [...]
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 37b044e78333..ed400d3a0ae1 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -504,6 +504,5 @@ static inline int uart_handle_break(struct uart_port *port)
>  /*
>   * Common device tree parsing helpers
>   */
> -void of_get_rs485_mode(struct device_node *np, struct serial_rs485 *rs485conf);
> -
> +void uart_get_rs485_mode(struct device *dev, struct serial_rs485 *rs485conf);

The comment above uart_get_rs485_mode is wrong now.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux