Re: [PATCH v2 04/10] serial: 8250: dw: Allow to use a fallback CPR value if not synthesized

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

 



On Thu, Mar 17, 2022 at 06:46:21PM +0100, Miquel Raynal wrote:
> From: Phil Edworthy <phil.edworthy@xxxxxxxxxxx>
> 
> DW UART controllers can be synthesized without the CPR register.
> In this case, allow to the platform information to provide a CPR value.

...

>  void dw8250_setup_port(struct uart_port *p)
>  {
>  	struct uart_8250_port *up = up_to_u8250p(p);
> +	const struct dw8250_platform_data *pdata = device_get_match_data(up->port.dev);

Why not p->dev?

...

>  	reg = dw8250_readl_ext(p, DW_UART_CPR);
> +	if (!reg && pdata)
> +		reg = pdata->cpr;

Perhaps

	if (!reg) {
		if (pdata)
			reg = pdata->cpr;
		dev_dbg("CPR is not available, using %x instead\n", reg);
	}

?

>  	if (!reg)
>  		return;

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux