ARM: shmobile: r8a7740 pinmux platform device cleanup
authorMagnus Damm <damm@opensource.se>
Wed, 3 Apr 2013 06:32:58 +0000 (15:32 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 5 Jun 2013 08:18:22 +0000 (17:18 +0900)
Use DEFINE_RES_MEM() and platform_device_register_simple()
to save a couple of lines of code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/setup-r8a7740.c

index 326a4ab0bd5f8ea0f6ba64f6a202ce60d9a66b40..3a6b6fe7b6c098bed8ecd22101e137fb7d568ceb 100644 (file)
@@ -70,29 +70,15 @@ void __init r8a7740_map_io(void)
 }
 
 /* PFC */
-static struct resource r8a7740_pfc_resources[] = {
-       [0] = {
-               .start  = 0xe6050000,
-               .end    = 0xe6057fff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 0xe605800c,
-               .end    = 0xe605802b,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device r8a7740_pfc_device = {
-       .name           = "pfc-r8a7740",
-       .id             = -1,
-       .resource       = r8a7740_pfc_resources,
-       .num_resources  = ARRAY_SIZE(r8a7740_pfc_resources),
+static const struct resource pfc_resources[] = {
+       DEFINE_RES_MEM(0xe6050000, 0x8000),
+       DEFINE_RES_MEM(0xe605800c, 0x0020),
 };
 
 void __init r8a7740_pinmux_init(void)
 {
-       platform_device_register(&r8a7740_pfc_device);
+       platform_device_register_simple("pfc-r8a7740", -1, pfc_resources,
+                                       ARRAY_SIZE(pfc_resources));
 }
 
 static struct renesas_intc_irqpin_config irqpin0_platform_data = {
This page took 0.0308389999999999 seconds and 5 git commands to generate.