]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
pwm-backlight:
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 12 Jun 2014 11:38:54 +0000 (13:38 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:08:19 +0000 (10:08 +0200)
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.

drivers/video/backlight/pwm_bl.c

index 38ca88bc5c3ed0c199e73b8a533ac43448506bfb..3d265c4b41bd4f30695b3f65134504d9ef88c3a9 100644 (file)
@@ -178,7 +178,7 @@ static int pwm_backlight_parse_dt(struct device *dev,
                data->dft_brightness = value;
                data->max_brightness--;
        }
-
+       data->enable_gpio = -EINVAL;
        return 0;
 }