diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-02-11 17:09:42 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-02-16 11:16:08 -0500 |
commit | 400797cad36850797307be3c56d2d5bc16aa02bb (patch) | |
tree | 145e8fcdee8bdf50ca07849cffd41b80a3bcaeaa /include/iomux.h | |
parent | b672c1619bb9615aff3ebbe15c20083fd0f58f9b (diff) | |
download | u-boot-400797cad36850797307be3c56d2d5bc16aa02bb.tar.gz |
IOMUX: Split out for_each_console_dev() helper macro
It is not only less lines of code, but also better readability
when new macro is being in use. Introduce for_each_console_dev()
helper macro and convert current users to it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'include/iomux.h')
-rw-r--r-- | include/iomux.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/iomux.h b/include/iomux.h index 9c2d579606..bd4a143b1e 100644 --- a/include/iomux.h +++ b/include/iomux.h @@ -24,6 +24,11 @@ extern struct stdio_dev **console_devices[MAX_FILES]; */ extern int cd_count[MAX_FILES]; +#define for_each_console_dev(i, file, dev) \ + for (i = 0, dev = console_devices[file][i]; \ + i < cd_count[file]; \ + i++, dev = console_devices[file][i]) + int iomux_match_device(struct stdio_dev **, const int, struct stdio_dev *); int iomux_doenv(const int, const char *); void iomux_printdevs(const int); |