diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-24 13:55:42 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-25 17:55:19 -0400 |
commit | f55aa4454ac315247986aec162e064674952a7ae (patch) | |
tree | 1bb08edac6a4d86229e9eee3ac84455778ca1534 /include/part.h | |
parent | d08db02d2d3d5ccf365e423b0c3dfb6fe311abd6 (diff) | |
download | u-boot-f55aa4454ac315247986aec162e064674952a7ae.tar.gz |
part: Add a fallback for part_get_bootable()
This function can be called when partition support is disabled. Add a
static inline to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/part.h')
-rw-r--r-- | include/part.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/part.h b/include/part.h index 16ba8c10253..f321479a5e9 100644 --- a/include/part.h +++ b/include/part.h @@ -372,14 +372,6 @@ part_get_info_by_dev_and_name_or_num(const char *dev_iface, } #endif -/** - * part_get_bootable() - Find the first bootable partition - * - * @desc: Block-device descriptor - * @return first bootable partition, or 0 if there is none - */ -int part_get_bootable(struct blk_desc *desc); - struct udevice; /** * disk_blk_read() - read blocks from a disk partition @@ -670,12 +662,24 @@ static inline struct part_driver *part_driver_get_first(void) */ int part_get_type_by_name(const char *name); +/** + * part_get_bootable() - Find the first bootable partition + * + * @desc: Block-device descriptor + * @return first bootable partition, or 0 if there is none + */ +int part_get_bootable(struct blk_desc *desc); + #else static inline int part_driver_get_count(void) { return 0; } static inline struct part_driver *part_driver_get_first(void) { return NULL; } + +static inline bool part_get_bootable(struct blk_desc *desc) +{ return false; } + #endif /* CONFIG_PARTITIONS */ #endif /* _PART_H */ |