summaryrefslogtreecommitdiff
path: root/common/stdio.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-18 07:36:52 -0400
committerTom Rini <trini@konsulko.com>2022-10-18 07:36:52 -0400
commit700b4fe782f9fc46b7be1b1a93a49356baeccc3f (patch)
tree7c4f01a95ceb7288ac9f95ffb59c2ea11b0a33cf /common/stdio.c
parentd3031d442b941f059eb83bb67ca10a28a0539f9a (diff)
parentae0bf2214b81b56a5670819958234947443680be (diff)
Merge tag 'dm-pull-18oct22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Update uclass iterators to work better when devices fail to probe Support VBE OS requests / fixups Minor error-handling tweaks to bootm command
Diffstat (limited to 'common/stdio.c')
-rw-r--r--common/stdio.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/common/stdio.c b/common/stdio.c
index 13083842cbd..e316a355fae 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -314,7 +314,6 @@ int stdio_init_tables(void)
int stdio_add_devices(void)
{
struct udevice *dev;
- struct uclass *uc;
int ret;
if (IS_ENABLED(CONFIG_DM_KEYBOARD)) {
@@ -324,24 +323,18 @@ int stdio_add_devices(void)
* have a list of input devices to start up in the stdin
* environment variable. That work probably makes more sense
* when stdio itself is converted to driver model.
- *
- * TODO(sjg@chromium.org): Convert changing
- * uclass_first_device() etc. to return the device even on
- * error. Then we could use that here.
*/
- ret = uclass_get(UCLASS_KEYBOARD, &uc);
- if (ret)
- return ret;
/*
* Don't report errors to the caller - assume that they are
* non-fatal
*/
- uclass_foreach_dev(dev, uc) {
- ret = device_probe(dev);
+ for (ret = uclass_first_device_check(UCLASS_KEYBOARD, &dev);
+ dev;
+ ret = uclass_next_device_check(&dev)) {
if (ret)
- printf("Failed to probe keyboard '%s'\n",
- dev->name);
+ printf("%s: Failed to probe keyboard '%s' (ret=%d)\n",
+ __func__, dev->name, ret);
}
}
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
@@ -361,13 +354,14 @@ int stdio_add_devices(void)
int ret;
if (!IS_ENABLED(CONFIG_SYS_CONSOLE_IS_IN_ENV)) {
- for (ret = uclass_first_device(UCLASS_VIDEO, &vdev);
- vdev;
- ret = uclass_next_device(&vdev))
- ;
- if (ret)
- printf("%s: Video device failed (ret=%d)\n",
- __func__, ret);
+ for (ret = uclass_first_device_check(UCLASS_VIDEO,
+ &vdev);
+ vdev;
+ ret = uclass_next_device_check(&vdev)) {
+ if (ret)
+ printf("%s: Failed to probe video device '%s' (ret=%d)\n",
+ __func__, vdev->name, ret);
+ }
}
if (IS_ENABLED(CONFIG_SPLASH_SCREEN) &&
IS_ENABLED(CONFIG_CMD_BMP))