[PATCH 09/13] syscon: Probe device first in syscon_get_regmap

Jiaxun Yang jiaxun.yang at flygoat.com
Wed May 15 02:12:15 CEST 2024



在2024年5月14日五月 下午3:50,Jonas Karlman写道:
> Hi Jiaxun,
[...]
>> +		return ERR_PTR(ret);
>
> Please explain in more details what the issue this is trying to solve.
>
> Typically syscon_get_regmap() is called on a udevice returned from a
> uclass_get_device call, and that should trigger a probe for the device
> and its parents.
>
> Adding device_probe() here possible just hides an issue that exists
> somewhere else. In what instance are you ending up with a call to
> this function with a udevice that has not been probed?

Hi Jonas,

Thanks for the reply, my problem is in [PATCH 10/13] I'm using dev->parent
directly to get parent device and then use that pointer to access
syscon_get_regmap.

There is no chance to invoke uclass_get_device_* as what we need is just
the parent device.

I can think of two solution without touching syscon code here.

First would be performing uclass_get_device_by_ofnode against parent's
ofnode, which seems a little bit overkilling.

Second would be trigger probing in dev_get_parent.

Thanks
- Jiaxun

>
> Also, please add a new test to test/dm/regmap.c if this solves a real
> issue.
>
> Regards,
> Jonas
>
>>  	priv = dev_get_uclass_priv(dev);
>>  	return priv->regmap;
>>  }
>>

-- 
- Jiaxun


More information about the U-Boot mailing list