ARM: imx/armadillo5x0: dynamically allocate physmap-flash device

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
Uwe Kleine-König 2011-07-31 00:20:30 +02:00
parent f2f07be02d
commit 47ccfc340a
1 changed files with 7 additions and 11 deletions

View File

@ -314,25 +314,19 @@ static struct mtd_partition armadillo5x0_nor_flash_partitions[] = {
}, },
}; };
static struct physmap_flash_data armadillo5x0_nor_flash_pdata = { static const struct physmap_flash_data
armadillo5x0_nor_flash_pdata __initconst = {
.width = 2, .width = 2,
.parts = armadillo5x0_nor_flash_partitions, .parts = armadillo5x0_nor_flash_partitions,
.nr_parts = ARRAY_SIZE(armadillo5x0_nor_flash_partitions), .nr_parts = ARRAY_SIZE(armadillo5x0_nor_flash_partitions),
}; };
static struct resource armadillo5x0_nor_flash_resource = { static const struct resource armadillo5x0_nor_flash_resource __initconst = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
.start = MX31_CS0_BASE_ADDR, .start = MX31_CS0_BASE_ADDR,
.end = MX31_CS0_BASE_ADDR + SZ_64M - 1, .end = MX31_CS0_BASE_ADDR + SZ_64M - 1,
}; };
static struct platform_device armadillo5x0_nor_flash = {
.name = "physmap-flash",
.id = -1,
.num_resources = 1,
.resource = &armadillo5x0_nor_flash_resource,
};
/* /*
* FB support * FB support
*/ */
@ -514,8 +508,10 @@ static void __init armadillo5x0_init(void)
imx31_add_mx3_sdc_fb(&mx3fb_pdata); imx31_add_mx3_sdc_fb(&mx3fb_pdata);
/* Register NOR Flash */ /* Register NOR Flash */
mxc_register_device(&armadillo5x0_nor_flash, platform_device_register_resndata(NULL, "physmap-flash", -1,
&armadillo5x0_nor_flash_pdata); &armadillo5x0_nor_flash_resource, 1,
&armadillo5x0_nor_flash_pdata,
sizeof(armadillo5x0_nor_flash_pdata));
/* Register NAND Flash */ /* Register NAND Flash */
imx31_add_mxc_nand(&armadillo5x0_nand_board_info); imx31_add_mxc_nand(&armadillo5x0_nand_board_info);