Merge tag 'backlight-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / drivers / video / backlight / pwm_bl.c
index 6897f1c1bc732efe36632895fcedc577b7292a33..eff379b234ccfef7ce0a6abc96e4b9d8e3c6125a 100644 (file)
@@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
        pb->dev = &pdev->dev;
        pb->enabled = false;
 
-       pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
+       pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+                                                 GPIOD_OUT_HIGH);
        if (IS_ERR(pb->enable_gpio)) {
                ret = PTR_ERR(pb->enable_gpio);
                goto err_alloc;
@@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
                pb->enable_gpio = gpio_to_desc(data->enable_gpio);
        }
 
-       if (pb->enable_gpio)
-               gpiod_direction_output(pb->enable_gpio, 1);
-
        pb->power_supply = devm_regulator_get(&pdev->dev, "power");
        if (IS_ERR(pb->power_supply)) {
                ret = PTR_ERR(pb->power_supply);