]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
pwm-backlight: Fix bogus request for GPIO#0 when instantiated from DT
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 06:38:36 +0000 (08:38 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 20 Aug 2014 12:23:00 +0000 (13:23 +0100)
commit 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
introduced a regression leading to acquiring a bogus GPIO-0 when
configured from DT without an 'enable-gpios' property.
The driver will happily accept the 0 initialized 'enable_gpio' member
of the struct platform_pwm_backlight_data as valid gpio number, and
request this GPIO as enable pin. In case of multiple driver instances,
the second will fail to register with the error message:
pwm-backlight backlight1.23: failed to request GPIO#0: -16

Fix this by setting enable_gpio in the pdata struct to -EINVAL.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c

index d7a3d13e72ec3900232c34ab35d121eadfff2683..b85983e97f0afbc70665d1aa134d5b182e25976e 100644 (file)
@@ -173,6 +173,7 @@ static int pwm_backlight_parse_dt(struct device *dev,
                data->max_brightness--;
        }
 
+       data->enable_gpio = -EINVAL;
        return 0;
 }