aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-09-01 16:27:27 -0600
committerSimon Glass <sjg@chromium.org>2024-10-18 14:10:21 -0600
commit8c3e44d307e34ea8efe524e3b5c0bac79f22f280 (patch)
tree07de7f9261b10d5c4bcb4e732da7401903a5e8c1
parenta768742d65c7d96ab0a8737fed7c1360f84706dc (diff)
downloadu-boot-8c3e44d307e34ea8efe524e3b5c0bac79f22f280.tar.gz
blk: Make functions available unconditionally
Some boards still don't enable BLK but we want to be able to at least compile the code which relies on this. For example, bootstd includes calls to blk_...() functions, albeit with a check for BLK so that the code is eliminated by the compiler. Reduce the scope of the BLK #ifdef to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--include/blk.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/blk.h b/include/blk.h
index 1fc9a5b8471..eef6c8629e8 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -197,7 +197,6 @@ static inline void blkcache_free(void) {}
#endif
-#if CONFIG_IS_ENABLED(BLK)
struct udevice;
/* Operations on block devices */
@@ -278,6 +277,8 @@ struct blk_ops {
#endif /* CONFIG_BOUNCE_BUFFER */
};
+#if CONFIG_IS_ENABLED(BLK)
+
/*
* These functions should take struct udevice instead of struct blk_desc,
* but this is convenient for migration to driver model. Add a 'd' prefix
@@ -291,6 +292,8 @@ unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start,
unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt);
+#endif /* BLK */
+
/**
* blk_read() - Read from a block device
*
@@ -528,8 +531,10 @@ struct blk_desc *blk_get_by_device(struct udevice *dev);
*/
int blk_get_desc(enum uclass_id uclass_id, int devnum, struct blk_desc **descp);
-#else
+#if !CONFIG_IS_ENABLED(BLK)
+
#include <errno.h>
+
/*
* These functions should take struct udevice instead of struct blk_desc,
* but this is convenient for migration to driver model. Add a 'd' prefix