ARM: imx: 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>
This commit is contained in:

committed by
Sascha Hauer

parent
72370a5cc2
commit
47e837b54c
@@ -193,19 +193,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_led_platform_data eukrea_mbimxsd_led_info = {
|
||||
static const struct gpio_led_platform_data
|
||||
eukrea_mbimxsd_led_info __initconst = {
|
||||
.leds = eukrea_mbimxsd_leds,
|
||||
.num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds),
|
||||
};
|
||||
|
||||
static struct platform_device eukrea_mbimxsd_leds_gpio = {
|
||||
.name = "leds-gpio",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &eukrea_mbimxsd_led_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
|
||||
{
|
||||
.gpio = GPIO_SWITCH1,
|
||||
@@ -223,7 +216,6 @@ static const struct gpio_keys_platform_data
|
||||
};
|
||||
|
||||
static struct platform_device *platform_devices[] __initdata = {
|
||||
&eukrea_mbimxsd_leds_gpio,
|
||||
&eukrea_mbimxsd_lcd_powerdev,
|
||||
};
|
||||
|
||||
@@ -299,5 +291,6 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
|
||||
ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
|
||||
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user