mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-08-20 20:26:12 -04:00
serial: Reorder get_current()
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>
This commit is contained in:
parent
6d93e25806
commit
dee1941604
@ -227,20 +227,23 @@ static struct serial_device *get_current(void)
|
|||||||
{
|
{
|
||||||
struct serial_device *dev;
|
struct serial_device *dev;
|
||||||
|
|
||||||
if (!(gd->flags & GD_FLG_RELOC) || !serial_current) {
|
if (!(gd->flags & GD_FLG_RELOC))
|
||||||
dev = default_serial_console();
|
dev = default_serial_console();
|
||||||
|
else if (!serial_current)
|
||||||
/* We must have a console device */
|
dev = default_serial_console();
|
||||||
if (!dev) {
|
else
|
||||||
#ifdef CONFIG_SPL_BUILD
|
|
||||||
puts("Cannot find console\n");
|
|
||||||
hang();
|
|
||||||
#else
|
|
||||||
panic("Cannot find console\n");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
dev = serial_current;
|
dev = serial_current;
|
||||||
|
|
||||||
|
/* We must have a console device */
|
||||||
|
if (!dev) {
|
||||||
|
#ifdef CONFIG_SPL_BUILD
|
||||||
|
puts("Cannot find console\n");
|
||||||
|
hang();
|
||||||
|
#else
|
||||||
|
panic("Cannot find console\n");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user