[PATCH v2 08/10] ARM: pca100: convert to devfs_create_partitions

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Feb 27 15:39:08 EST 2014


Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 arch/arm/boards/phycard-i.MX27/pca100.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index 2ff1b793291c..5bae8a92f886 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -175,10 +175,27 @@ static void pca100_usb_init(void)
 	gpio_direction_output(GPIO_PORTB + 24, 1);
 }
 
+static const struct devfs_partition pca100_nand0_partitions[] = {
+	{
+		.offset = 0x00000,
+		.size = 0x40000,
+		.flags = DEVFS_PARTITION_FIXED,
+		.name = "self_raw",
+		.bbname = "self0",
+	}, {
+		.offset = DEVFS_PARTITION_APPEND, /* 0x40000 */
+		.size = 0x20000,
+		.flags = DEVFS_PARTITION_FIXED,
+		.name = "env_raw",
+		.bbname = "env0",
+	}, {
+		/* sentinel */
+	}
+};
+
 static int pca100_devices_init(void)
 {
 	int i;
-	struct device_d *nand;
 
 	unsigned int mode[] = {
 		PD0_AIN_FEC_TXD0,
@@ -286,12 +303,7 @@ static int pca100_devices_init(void)
 	pca100_usb_register();
 #endif
 
-	nand = get_device_by_name("nand0");
-	devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw");
-	dev_add_bb_dev("self_raw", "self0");
-
-	devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw");
-	dev_add_bb_dev("env_raw", "env0");
+	devfs_create_partitions("nand0", pca100_nand0_partitions);
 
 	armlinux_set_architecture(2149);
 
-- 
1.8.5.3




More information about the barebox mailing list