[U-Boot] [U-Boot,V2,2/5] spl: Add EXT support to SPL

Tom Rini trini at ti.com
Mon Oct 27 23:22:58 CET 2014


On Wed, Oct 15, 2014 at 05:53:12PM +0200, Guillaume GARDET wrote:

> Add EXT filesystem support to SPL.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet at free.fr>
> Cc: Tom Rini <trini at ti.com>

With the following change:
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 7342268..7fbf3df 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -24,7 +24,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 	if (get_partition_info(block_dev,
 		partition, &part_info)) {
 		printf("spl: no partition table found\n");
-		goto end;
+		return -1;
 	}
 
 	ext4fs_set_blk_dev(block_dev, &part_info);
@@ -39,7 +39,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 
 	filelen = err = ext4fs_open(filename);
 	if (err < 0) {
-	puts("spl: ext4fs_open failed\n");
+		puts("spl: ext4fs_open failed\n");
 		goto end;
 	}
 	err = ext4fs_read((char *)header, sizeof(struct image_header));
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 7342268..d9eba5a 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -22,9 +22,9 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 						sizeof(struct image_header));
 
 	if (get_partition_info(block_dev,
-		partition, &part_info)) {
+			       partition, &part_info)) {
 		printf("spl: no partition table found\n");
-		goto end;
+		return -1;
 	}
 
 	ext4fs_set_blk_dev(block_dev, &part_info);
@@ -39,7 +39,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
 
 	filelen = err = ext4fs_open(filename);
 	if (err < 0) {
-	puts("spl: ext4fs_open failed\n");
+		puts("spl: ext4fs_open failed\n");
 		goto end;
 	}
 	err = ext4fs_read((char *)header, sizeof(struct image_header));
@@ -59,7 +59,7 @@ end:
 		       __func__, filename, err);
 #endif
 
-	return (err <= 0);
+	return err <= 0;
 }
 
 #ifdef CONFIG_SPL_OS_BOOT
@@ -69,9 +69,9 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
 	int filelen;
 	disk_partition_t part_info = {};
 	__maybe_unused char *file;
-	
+
 	if (get_partition_info(block_dev,
-		partition, &part_info)) {
+			       partition, &part_info)) {
 		printf("spl: no partition table found\n");
 		return -1;
 	}
@@ -94,7 +94,7 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
 			puts("spl: ext4fs_open failed\n");
 			goto defaults;
 		}
-		err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+		err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
 		if (err <= 0) {
 			printf("spl: error reading image %s, err - %d, falling back to default\n",
 			       file, err);
@@ -109,19 +109,21 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
 			}
 
 			return 0;
-		} else
+		} else {
 			puts("spl: falcon_image_file not set in environment, falling back to default\n");
-	} else
+		}
+	} else {
 		puts("spl: falcon_args_file not set in environment, falling back to default\n");
+	}
 
 defaults:
 #endif
 
 	filelen = err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME);
-		if (err < 0) {
-			puts("spl: ext4fs_open failed\n");
-		}
-	err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+	if (err < 0)
+		puts("spl: ext4fs_open failed\n");
+
+	err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
 	if (err <= 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("%s: error reading image %s, err - %d\n",
@@ -135,4 +137,3 @@ defaults:
 }
 #endif
 #endif
-

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141027/784a0479/attachment.pgp>


More information about the U-Boot mailing list