]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: imx/mx1ads: dynamically allocate physmap-flash device
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sat, 30 Jul 2011 22:19:55 +0000 (00:19 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 1 Aug 2011 09:16:57 +0000 (11:16 +0200)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
arch/arm/mach-imx/mach-mx1ads.c

index 5cd8bee4696025525112bd585e90790e813eb221..e8867ffd68cfb3d04e092de6f1ae059d776efe77 100644 (file)
@@ -68,23 +68,16 @@ static const struct imxuart_platform_data uart1_pdata __initconst = {
  * Physmap flash
  */
 
-static struct physmap_flash_data mx1ads_flash_data = {
+static const struct physmap_flash_data mx1ads_flash_data __initconst = {
        .width          = 4,            /* bankwidth in bytes */
 };
 
-static struct resource flash_resource = {
+static const struct resource flash_resource __initconst = {
        .start  = MX1_CS0_PHYS,
        .end    = MX1_CS0_PHYS + SZ_32M - 1,
        .flags  = IORESOURCE_MEM,
 };
 
-static struct platform_device flash_device = {
-       .name   = "physmap-flash",
-       .id     = 0,
-       .resource = &flash_resource,
-       .num_resources = 1,
-};
-
 /*
  * I2C
  */
@@ -125,7 +118,9 @@ static void __init mx1ads_init(void)
        imx1_add_imx_uart1(&uart1_pdata);
 
        /* Physmap flash */
-       mxc_register_device(&flash_device, &mx1ads_flash_data);
+       platform_device_register_resndata(NULL, "physmap-flash", 0,
+                       &flash_resource, 1,
+                       &mx1ads_flash_data, sizeof(mx1ads_flash_data));
 
        /* I2C */
        i2c_register_board_info(0, mx1ads_i2c_devices,