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

Jiaxun Yang jiaxun.yang at flygoat.com
Mon May 13 20:13:06 CEST 2024


When bootph-all is enabled for a syscon driver, the device
may leave unprobed when syscon_get_regmap is called by another
driver.

Perform device_probe in syscon_get_regmap, there is no side
affect as device_probe will return 0 quickly for an activated
device.

Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
---
 drivers/core/syscon-uclass.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c
index f0e69d7216b3..b09f7013194d 100644
--- a/drivers/core/syscon-uclass.c
+++ b/drivers/core/syscon-uclass.c
@@ -32,10 +32,14 @@
  */
 struct regmap *syscon_get_regmap(struct udevice *dev)
 {
+	int ret;
 	struct syscon_uc_info *priv;
 
 	if (device_get_uclass_id(dev) != UCLASS_SYSCON)
 		return ERR_PTR(-ENOEXEC);
+	ret = device_probe(dev);
+	if (ret)
+		return ERR_PTR(ret);
 	priv = dev_get_uclass_priv(dev);
 	return priv->regmap;
 }

-- 
2.34.1



More information about the U-Boot mailing list