summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-05-16 10:08:10 -0400
committerLee Jones <lee.jones@linaro.org>2015-06-23 10:47:34 -0400
commitcdaefccefa988495e732d85d81914fbba99f4ca6 (patch)
tree8aea93f7163c652a3b485bc91e14bd7fd1a6be93 /drivers/video
parent61c1c6147f69d8dea31fd133d2ec0b1594c9a3eb (diff)
backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions), the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Simplify the usage of devm_gpiod_get_optional accordingly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/pwm_bl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 3a145a643e0d..57cb9ec8be43 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
241 pb->dev = &pdev->dev; 241 pb->dev = &pdev->dev;
242 pb->enabled = false; 242 pb->enabled = false;
243 243
244 pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable"); 244 pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
245 GPIOD_OUT_HIGH);
245 if (IS_ERR(pb->enable_gpio)) { 246 if (IS_ERR(pb->enable_gpio)) {
246 ret = PTR_ERR(pb->enable_gpio); 247 ret = PTR_ERR(pb->enable_gpio);
247 goto err_alloc; 248 goto err_alloc;
@@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
263 pb->enable_gpio = gpio_to_desc(data->enable_gpio); 264 pb->enable_gpio = gpio_to_desc(data->enable_gpio);
264 } 265 }
265 266
266 if (pb->enable_gpio)
267 gpiod_direction_output(pb->enable_gpio, 1);
268
269 pb->power_supply = devm_regulator_get(&pdev->dev, "power"); 267 pb->power_supply = devm_regulator_get(&pdev->dev, "power");
270 if (IS_ERR(pb->power_supply)) { 268 if (IS_ERR(pb->power_supply)) {
271 ret = PTR_ERR(pb->power_supply); 269 ret = PTR_ERR(pb->power_supply);