]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
leds: lt3593: Remove unneeded assignment in lt3593_led_probe
authorYueHaibing <yuehaibing@huawei.com>
Sat, 23 Mar 2019 11:26:59 +0000 (11:26 +0000)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sun, 31 Mar 2019 18:12:30 +0000 (20:12 +0200)
As the chip can't be queried for it's current state, the "keep" option
doesn't make sense. The only option in DT should be turn the LED on or
off at probe time. Also 'flags' is never used since introduction.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-lt3593.c

index 54f0e5dbdbd03a131260dd454203b8ec66f427fd..83e8e58d81cb8b20df2273889771d75ed8b24d12 100644 (file)
@@ -66,7 +66,6 @@ static int lt3593_led_probe(struct platform_device *pdev)
        struct lt3593_led_data *led_data;
        struct fwnode_handle *child;
        int ret, state = LEDS_GPIO_DEFSTATE_OFF;
-       enum gpiod_flags flags = GPIOD_OUT_LOW;
        const char *tmp;
 
        if (!dev->of_node)
@@ -99,13 +98,8 @@ static int lt3593_led_probe(struct platform_device *pdev)
                                    &led_data->cdev.default_trigger);
 
        if (!fwnode_property_read_string(child, "default-state", &tmp)) {
-               if (!strcmp(tmp, "keep")) {
-                       state = LEDS_GPIO_DEFSTATE_KEEP;
-                       flags = GPIOD_ASIS;
-               } else if (!strcmp(tmp, "on")) {
+               if (!strcmp(tmp, "on"))
                        state = LEDS_GPIO_DEFSTATE_ON;
-                       flags = GPIOD_OUT_HIGH;
-               }
        }
 
        led_data->cdev.name = led_data->name;