diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c index e57c409c318c..75674b4cc91d 100644 --- a/arch/mips/txx9/rbtx4927/setup.c +++ b/arch/mips/txx9/rbtx4927/setup.c @@ -327,11 +327,19 @@ static void __init rbtx4927_mtd_init(void) tx4927_mtd_init(i); } +static struct gpiod_lookup_table rbtx4927_gpioled_table = { + .table = { + GPIO_LOOKUP_IDX("TXx9", 0, NULL, 0, GPIO_ACTIVE_LOW), + GPIO_LOOKUP_IDX("TXx9", 1, NULL, 1, GPIO_ACTIVE_LOW), + { }, + }, +}; + static void __init rbtx4927_gpioled_init(void) { static const struct gpio_led leds[] = { - { .name = "gpioled:green:0", .gpio = 0, .active_low = 1, }, - { .name = "gpioled:green:1", .gpio = 1, .active_low = 1, }, + { .name = "gpioled:green:0", }, + { .name = "gpioled:green:1", }, }; static struct gpio_led_platform_data pdata = { .num_leds = ARRAY_SIZE(leds), @@ -342,8 +350,13 @@ static void __init rbtx4927_gpioled_init(void) if (!pdev) return; pdev->dev.platform_data = &pdata; - if (platform_device_add(pdev)) + if (platform_device_add(pdev)) { platform_device_put(pdev); + return; + } + + rbtx4927_gpioled_table.dev_id = dev_name(&pdev->dev); + gpiod_add_lookup_table(&rbtx4927_gpioled_table); } static void __init rbtx4927_device_init(void)