[PATCH 1/1] serial: ns16550: move iomem/ioport init after clock init

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Feb 17 06:10:32 PST 2023


Hello Maxim,

On 17.02.23 15:03, Maxim Kochetkov wrote:
> 
> 
> On 17.02.2023 12:02, Ahmad Fatoum wrote:
>> Hello Maxim,
>>
>> On 17.02.23 08:31, Maxim Kochetkov wrote:
>>> -    ret = ns16550_init_iomem(dev, priv);
>>> -    if (ret)
>>> -        ret = ns16550_init_ioport(dev, priv);
>>> -
>>>       if (ret)
>>>           return ret;
>>
>> ret is now uninitialized here.
>>
>>>   @@ -511,6 +507,10 @@ static int ns16550_probe(struct device *dev)
>>>           goto err;
>>>       }
>>>   +    ret = ns16550_init_iomem(dev, priv);
>>> +    if (ret)
>>> +        ret = ns16550_init_ioport(dev, priv);
>>
>> second ret is never checked.
> 
> Sorry about that. I will fix it in v2.
>>
>> If you move the second if (ret), patch looks ok to me.
>> jfyi, If you enable deep probe for your board/platform, clk_get()
>> would automatically probe the clock driver if unavailable, so you
>> shouldn't ever see -EPROBE_DEFER.
> 
> I tried deep probe and it works fine without any -EPROBE_DEFER. Thanks a lot for the tip!

Nice! It's not enabled globally as some existing boards may need rework
(e.g. you need to place of_device_ensure_probed into board code), but new
boards should perferably always use it and just save the time needed to do
EPROBE_DEFER altogether.

Cheers,
Ahmad

> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list