pinctrl: change result for unsupported API
PATCH RESEND 1/2 pinctrl: change result for unsupported API
Use the return value ENOSYS for unsupported API
- pinctrl_generic_set_state
- pinctrl_select_state
---
include/dm/pinctrl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/dm/pinctrl.h +2 -2
@@ -495,7 +495,7 @@ int pinctrl_generic_set_state(struct udevice *pctldev, struct udevice *config);static inline int pinctrl_generic_set_state (struct udevice *pctldev,struct udevice *config) { -return -EINVAL ; +return -ENOSYS ; }#endif
@@ -512,7 +512,7 @@ int pinctrl_select_state(struct udevice *dev, const char *statename);static inline int pinctrl_select_state (struct udevice *dev,const char *statename) { -return -EINVAL ; +return -ENOSYS ; }#endif
Signature · 1 line
2.25.1
PATCH RESEND 2/2 dm: add debug message when failed to select the default pinctrl
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.
---
drivers/core/device.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/core/device.c +12 -4
@@ -533,8 +533,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) &&
@@ -586,8 +590,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:
Signature · 1 line
2.25.1
Re: [RESEND PATCH 2/2] dm: add debug message when failed to select the default pinctrl
Quoted 8 lines · Patrick Delaunay
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 <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom
Quoted 6 lines · Patrick Delaunay
Use the return value ENOSYS for unsupported API
-pinctrl_generic_set_state
-pinctrl_select_stateSigned-off-by Patrick Delaunay <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom