Re: [PATCH 2/4] serial: 8250: of: Load TX FIFO Load Size from DT

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

 



On Thu, Sep 08, 2016 at 11:12:19AM -0500, tthayer@xxxxxxxxxxxxxxxxxxxxx wrote:
> From: Thor Thayer <tthayer@xxxxxxxxxxxxxxxxxxxxx>
> 
> Initialize the tx_loadsz parameter if it is defined in the
> device tree.
> 
> Signed-off-by: Thor Thayer <tthayer@xxxxxxxxxxxxxxxxxxxxx>
> ---
>  drivers/tty/serial/8250/8250_of.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
> index 38963d7..3e4be2f 100644
> --- a/drivers/tty/serial/8250/8250_of.c
> +++ b/drivers/tty/serial/8250/8250_of.c
> @@ -195,6 +195,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
>  	switch (port_type) {
>  	case PORT_8250 ... PORT_MAX_8250:
>  	{
> +		u32 prop;
>  		struct uart_8250_port port8250;
>  		memset(&port8250, 0, sizeof(port8250));
>  		port8250.port = port;
> @@ -202,6 +203,11 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
>  		if (port.fifosize)
>  			port8250.capabilities = UART_CAP_FIFO;
>  
> +		/* Check for TX fifo load size */
> +		if (of_property_read_u32(ofdev->dev.of_node,
> +					 "tx-loadsz", &prop) == 0)
> +			port8250.tx_loadsz = prop;

This can be simplified to:

of_property_read_u32(ofdev->dev.of_node, "tx-loadsz", &port8250.tx_loadsz);


> +
>  		if (of_property_read_bool(ofdev->dev.of_node,
>  					  "auto-flow-control"))
>  			port8250.capabilities |= UART_CAP_AFE;
> -- 
> 1.7.9.5
> 
--
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