Message ID | 1431785290.6638.1.camel@ingics.com |
---|---|
State | Accepted |
Headers | show |
On Sat, 16 May 2015, Axel Lin wrote: > 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> > --- > drivers/video/backlight/pwm_bl.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Applied, thanks. > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c > index 3a145a6..57cb9ec 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) > 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);
Hello, On Sat, May 16, 2015 at 10:08:10PM +0800, Axel Lin wrote: > 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> as I just sent the same patch: Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> @Axel: Do you have some more patches of this type in the queue? I currently have several fixes on top of 4.1-rc4. Some of them are still in a single wip patch, some other are already sent out. Best regards Uwe
2015-05-19 15:59 GMT+08:00 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>: > Hello, > > On Sat, May 16, 2015 at 10:08:10PM +0800, Axel Lin wrote: >> 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> > as I just sent the same patch: > > Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > @Axel: Do you have some more patches of this type in the queue? I No, I don't have other patches of this type in the queue. Regards, Axel -- To unsubscribe from this list: send the line "unsubscribe linux-pwm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 3a145a6..57cb9ec 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) 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);
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> --- drivers/video/backlight/pwm_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)