[PATCH 09/10] ARM: pcm038: convert to devfs_create_partitions
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Tue Feb 25 17:51:20 EST 2014
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
arch/arm/boards/pcm038/pcm038.c | 41 +++++++++++++++++++++++++++++++----------
1 file changed, 31 insertions(+), 10 deletions(-)
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 1733261f7d04..a5171cc920ce 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -336,19 +336,40 @@ static int pcm038_devices_init(void)
switch (bootsource_get()) {
case BOOTSOURCE_NAND:
- devfs_add_partition("nand0", 0, SZ_512K,
- DEVFS_PARTITION_FIXED, "self_raw");
- dev_add_bb_dev("self_raw", "self0");
- devfs_add_partition("nand0", SZ_512K, SZ_128K,
- DEVFS_PARTITION_FIXED, "env_raw");
- dev_add_bb_dev("env_raw", "env0");
+ devfs_create_partitions("nand0", (struct devfs_partition[]){
+ {
+ .offset = 0,
+ .size = SZ_512K,
+ .flags = DEVFS_PARTITION_FIXED,
+ .name = "self_raw",
+ .bbname = "self0",
+ }, {
+ .offset = DEVFS_PARTITION_APPEND,
+ .size = SZ_128K,
+ .flags = DEVFS_PARTITION_FIXED,
+ .name = "env_raw",
+ .bbname = "env0",
+ }, {
+ /* sentinel */
+ }});
+
envdev = "NAND";
break;
default:
- devfs_add_partition("nor0", 0, SZ_512K,
- DEVFS_PARTITION_FIXED, "self0");
- devfs_add_partition("nor0", SZ_512K, SZ_128K,
- DEVFS_PARTITION_FIXED, "env0");
+ devfs_create_partitions("nor0", (struct devfs_partition[]){
+ {
+ .offset = 0,
+ .size = SZ_512K,
+ .flags = DEVFS_PARTITION_FIXED,
+ .name = "self0",
+ }, {
+ .offset = DEVFS_PARTITION_APPEND,
+ .size = SZ_128K,
+ .flags = DEVFS_PARTITION_FIXED,
+ .name = "env0",
+ }, {
+ /* sentinel */
+ }});
protect_file("/dev/env0", 1);
envdev = "NOR";
}
--
1.8.5.3
More information about the barebox
mailing list