[PATCH] fs: Allow to compile FS_BTRFS when SPL is enabled

Pali Rohár pali at kernel.org
Thu Apr 7 14:53:25 CEST 2022


Currently there is no btrfs support in SPL. But macro CONFIG_FS_BTRFS is
defined also when building SPL. When both FS_BTRFS and SPL are enabled
then build process throw compile error.

Fix check for btrfs code in fstypes[] to allow compiling FS_BTRFS only in
proper U-Boot.

Signed-off-by: Pali Rohár <pali at kernel.org>
---
 fs/fs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fs.c b/fs/fs.c
index b4306cf8499e..100a2a63810a 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -267,6 +267,7 @@ static struct fstype_info fstypes[] = {
 	},
 #endif
 #endif
+#ifndef CONFIG_SPL_BUILD
 #ifdef CONFIG_FS_BTRFS
 	{
 		.fstype = FS_TYPE_BTRFS,
@@ -286,6 +287,7 @@ static struct fstype_info fstypes[] = {
 		.ln = fs_ln_unsupported,
 	},
 #endif
+#endif
 #if CONFIG_IS_ENABLED(FS_SQUASHFS)
 	{
 		.fstype = FS_TYPE_SQUASHFS,
-- 
2.20.1



More information about the U-Boot mailing list