diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-05-28 15:05:02 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-07 03:59:57 -0400 |
commit | 5b8d628ca4036e76a2d892f2c1d01b58d232809e (patch) | |
tree | e7e6107cc728527afba516ad87e2e0e7c308910a /arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | |
parent | 47e837b54c01083ce153493882fb8d74d108ae4a (diff) |
ARM: mx5: convert to new leds-gpio registration helper
This gets rid of per machine struct platform_device definitions and allows
to move the platform data and led definition to .init.rodata.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c')
-rw-r--r-- | arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c index 97292d20f1f3..02ce720c887f 100644 --- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #define MBIMX51_LED2 IMX_GPIO_NR(3, 7) | 37 | #define MBIMX51_LED2 IMX_GPIO_NR(3, 7) |
38 | #define MBIMX51_LED3 IMX_GPIO_NR(3, 8) | 38 | #define MBIMX51_LED3 IMX_GPIO_NR(3, 8) |
39 | 39 | ||
40 | static struct gpio_led mbimx51_leds[] = { | 40 | static const struct gpio_led mbimx51_leds[] __initconst = { |
41 | { | 41 | { |
42 | .name = "led0", | 42 | .name = "led0", |
43 | .default_trigger = "heartbeat", | 43 | .default_trigger = "heartbeat", |
@@ -64,23 +64,11 @@ static struct gpio_led mbimx51_leds[] = { | |||
64 | }, | 64 | }, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | static struct gpio_led_platform_data mbimx51_leds_info = { | 67 | static const struct gpio_led_platform_data mbimx51_leds_info __initconst = { |
68 | .leds = mbimx51_leds, | 68 | .leds = mbimx51_leds, |
69 | .num_leds = ARRAY_SIZE(mbimx51_leds), | 69 | .num_leds = ARRAY_SIZE(mbimx51_leds), |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static struct platform_device mbimx51_leds_gpio = { | ||
73 | .name = "leds-gpio", | ||
74 | .id = -1, | ||
75 | .dev = { | ||
76 | .platform_data = &mbimx51_leds_info, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct platform_device *devices[] __initdata = { | ||
81 | &mbimx51_leds_gpio, | ||
82 | }; | ||
83 | |||
84 | static iomux_v3_cfg_t mbimx51_pads[] = { | 72 | static iomux_v3_cfg_t mbimx51_pads[] = { |
85 | /* UART2 */ | 73 | /* UART2 */ |
86 | MX51_PAD_UART2_RXD__UART2_RXD, | 74 | MX51_PAD_UART2_RXD__UART2_RXD, |
@@ -204,7 +192,7 @@ void __init eukrea_mbimx51_baseboard_init(void) | |||
204 | gpio_direction_output(MBIMX51_LED3, 1); | 192 | gpio_direction_output(MBIMX51_LED3, 1); |
205 | gpio_free(MBIMX51_LED3); | 193 | gpio_free(MBIMX51_LED3); |
206 | 194 | ||
207 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 195 | gpio_led_register_device(-1, &mbimx51_leds_info); |
208 | 196 | ||
209 | imx51_add_imx_keypad(&mbimx51_map_data); | 197 | imx51_add_imx_keypad(&mbimx51_map_data); |
210 | 198 | ||