[PATCH 2/2] dm: add debug message when failed to select the default pinctrl
Patrick Delaunay
patrick.delaunay at foss.st.com
Fri Jul 30 12:12:11 CEST 2021
Add a message on probe in driver model core when the default
pinctrl selection failed.
This message is displayed only when the pinctrl API is
implemented, i.e. when result is not ENOSYS.
Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
---
drivers/core/device.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 29668f6fb3..6710c847e1 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -532,8 +532,12 @@ int device_probe(struct udevice *dev)
* is set just above. However, the PCI bus' probe() method and
* associated uclass methods have not yet been called.
*/
- if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL)
- pinctrl_select_state(dev, "default");
+ if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL) {
+ ret = pinctrl_select_state(dev, "default");
+ if (ret && ret != -ENOSYS)
+ log_debug("Device '%s' failed to configure default pinctrl: %d (%s)\n",
+ dev->name, ret, errno_str(ret));
+ }
if (CONFIG_IS_ENABLED(POWER_DOMAIN) && dev->parent &&
(device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) &&
@@ -578,8 +582,12 @@ int device_probe(struct udevice *dev)
if (ret)
goto fail_uclass;
- if (dev->parent && device_get_uclass_id(dev) == UCLASS_PINCTRL)
- pinctrl_select_state(dev, "default");
+ if (dev->parent && device_get_uclass_id(dev) == UCLASS_PINCTRL) {
+ ret = pinctrl_select_state(dev, "default");
+ if (ret && ret != -ENOSYS)
+ log_debug("Device '%s' failed to configure default pinctrl: %d (%s)\n",
+ dev->name, ret, errno_str(ret));
+ }
return 0;
fail_uclass:
--
2.25.1
More information about the U-Boot
mailing list