[PATCH RESEND] serial: pl01x: set baudrate when probing

Yang Xiwen forbidden405 at outlook.com
Tue Feb 27 02:29:57 CET 2024


On 2/26/2024 4:23 PM, Dan Carpenter wrote:
> On Sun, Feb 25, 2024 at 08:38:33AM +0800, Yang Xiwen via B4 Relay wrote:
>>  #if CONFIG_IS_ENABLED(OF_PLATDATA)
>>  	struct dtd_serial_pl01x *dtplat = &plat->dtplat;
>> @@ -301,10 +302,14 @@ int pl01x_serial_probe(struct udevice *dev)
>>  #endif
>>  	priv->type = plat->type;
>>  
>> -	if (!plat->skip_init)
>> -		return pl01x_generic_serial_init(priv->regs, priv->type);
>> -	else
>> +	if (!plat->skip_init) {
>> +		ret = pl01x_generic_serial_init(priv->regs, priv->type);
>> +		if (!ret)
>                     ^^^^
> This if statement seems to be reversed.

Seems correct. Maybe i sent the wrong version.

> 
> regards,
> dan carpenter
> 
>> +			return ret;
>> +		return pl01x_serial_setbrg(dev, gd->baudrate);
>> +	} else {
>>  		return 0;
>> +	}
>>  }
> 

-- 
Best regards,
Yang Xiwen



More information about the U-Boot mailing list