]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/stdio.c
Merge branch 'rmobile-mx' of git://git.denx.de/u-boot-sh
[people/ms/u-boot.git] / common / stdio.c
index 8e4a9beef4542dab055489c31589a0f4c64b3707..2e5143a025533a214f873aaf22440ed74e2f6cef 100644 (file)
 #include <malloc.h>
 #include <stdio_dev.h>
 #include <serial.h>
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
 
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
+#if defined(CONFIG_SYS_I2C)
 #include <i2c.h>
 #endif
 
@@ -151,9 +148,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 +171,12 @@ static int stdio_probe_device(const char *name, enum uclass_id id,
 }
 #endif
 
-struct stdio_devstdio_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)) {
@@ -345,9 +343,6 @@ int stdio_add_devices(void)
 #ifdef CONFIG_SYS_I2C
        i2c_init_all();
 #else
-#if defined(CONFIG_HARD_I2C)
-       i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
 #endif
 #ifdef CONFIG_DM_VIDEO
        /*
@@ -382,9 +377,6 @@ int stdio_add_devices(void)
 #endif /* CONFIG_DM_VIDEO */
 #if defined(CONFIG_KEYBOARD) && !defined(CONFIG_DM_KEYBOARD)
        drv_keyboard_init ();
-#endif
-#ifdef CONFIG_LOGBUFFER
-       drv_logbuff_init ();
 #endif
        drv_system_init ();
        serial_stdio_init ();