aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-11-26 09:26:27 -0500
committerTom Rini <trini@konsulko.com>2016-11-26 09:26:27 -0500
commit8d0898544e0930974f39d9f13de2a874a501aa18 (patch)
treee79257510f56afa87294d9dad3638d6df9590113 /common
parentce4f2dbe1a066a42a995c6f48280e2e1a5df1c92 (diff)
parent6b388f0bed0e3d021128b4fc3c41da4572984e3b (diff)
downloadu-boot-8d0898544e0930974f39d9f13de2a874a501aa18.zip
u-boot-8d0898544e0930974f39d9f13de2a874a501aa18.tar.gz
u-boot-8d0898544e0930974f39d9f13de2a874a501aa18.tar.bz2
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'common')
-rw-r--r--common/stdio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/stdio.c b/common/stdio.c
index 8e4a9be..4d30017 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -151,9 +151,10 @@ static int stdio_probe_device(const char *name, enum uclass_id id,
*sdevp = NULL;
seq = trailing_strtoln(name, NULL);
if (seq == -1)
+ seq = 0;
+ ret = uclass_get_device_by_seq(id, seq, &dev);
+ if (ret == -ENODEV)
ret = uclass_first_device_err(id, &dev);
- else
- ret = uclass_get_device_by_seq(id, seq, &dev);
if (ret) {
debug("No %s device for seq %d (%s)\n", uclass_get_name(id),
seq, name);
@@ -173,12 +174,12 @@ static int stdio_probe_device(const char *name, enum uclass_id id,
}
#endif
-struct stdio_dev* stdio_get_by_name(const char *name)
+struct stdio_dev *stdio_get_by_name(const char *name)
{
struct list_head *pos;
struct stdio_dev *sdev;
- if(!name)
+ if (!name)
return NULL;
list_for_each(pos, &(devs.list)) {