summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d93e25)
raw | patch | inline | side by side (parent: 6d93e25)
author | Marek Vasut <marex@denx.de> | |
Sat, 6 Oct 2012 14:07:04 +0000 (14:07 +0000) | ||
committer | Tom Rini <trini@ti.com> | |
Wed, 17 Oct 2012 14:55:51 +0000 (07:55 -0700) |
Reorder the get_current() function to make it a bit more readable.
The code does not grow and there is minor change in the code logic,
where dev != NULL is now checked in any case.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
The code does not grow and there is minor change in the code logic,
where dev != NULL is now checked in any case.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
drivers/serial/serial.c | patch | blob | history |
index 3ab323bcb884070cf21b9d24272cf06bee03e36c..18b9ed4330f6449958e3e0fbf01b63f0b2d2e6bf 100644 (file)
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
{
struct serial_device *dev;
- if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
+ if (!(gd->flags & GD_FLG_RELOC))
dev = default_serial_console();
+ else if (!serial_current)
+ dev = default_serial_console();
+ else
+ dev = serial_current;
- /* We must have a console device */
- if (!dev) {
+ /* We must have a console device */
+ if (!dev) {
#ifdef CONFIG_SPL_BUILD
- puts("Cannot find console\n");
- hang();
+ puts("Cannot find console\n");
+ hang();
#else
- panic("Cannot find console\n");
+ panic("Cannot find console\n");
#endif
- }
- } else
- dev = serial_current;
+ }
+
return dev;
}