diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2019-10-22 16:39:20 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-07 11:13:24 -0500 |
commit | 02806e9ac1fbff2f1507f5565d738ac4e3c25709 (patch) | |
tree | 67a47a01eec6f21ff3642f8a1bb4b8a41a7579c0 /include | |
parent | d42730e8c67a0955c2f8236157b4723c585b9d24 (diff) |
include: board: provide empty stubs when the BOARD option is not selected
Useful to avoid #ifdef throughout the code that uses the board driver API.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/board.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/board.h b/include/board.h index fd6a486702..678b652b0a 100644 --- a/include/board.h +++ b/include/board.h @@ -31,6 +31,7 @@ * to read the serial number. */ +#if CONFIG_IS_ENABLED(BOARD) struct board_ops { /** * detect() - Run the hardware info detection procedure for this @@ -174,3 +175,39 @@ int board_get(struct udevice **devp); */ int board_get_fit_loadable(struct udevice *dev, int index, const char *type, const char **strp); + +#else + +static inline int board_detect(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int board_get_bool(struct udevice *dev, int id, bool *val) +{ + return -ENOSYS; +} + +static inline int board_get_int(struct udevice *dev, int id, int *val) +{ + return -ENOSYS; +} + +static inline int board_get_str(struct udevice *dev, int id, size_t size, + char *val) +{ + return -ENOSYS; +} + +static inline int board_get(struct udevice **devp) +{ + return -ENOSYS; +} + +static inline int board_get_fit_loadable(struct udevice *dev, int index, + const char *type, const char **strp) +{ + return -ENOSYS; +} + +#endif |