diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-05-28 10:05:15 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-06-03 12:41:53 +0300 |
commit | ca8c67dafdb7eb543015f1f84bb73f4454e41ca6 (patch) | |
tree | 517e5e5eae5e4ef3c2711ebba98796f8847ebefd /drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c | |
parent | 9ccfc4aa6939b06c7d0cd1de04949be1eb2b0836 (diff) | |
download | lwn-ca8c67dafdb7eb543015f1f84bb73f4454e41ca6.tar.gz lwn-ca8c67dafdb7eb543015f1f84bb73f4454e41ca6.zip |
fbdev: omap2: improve usage of gpiod API
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.
Also make use of gpiod_get*_optional where applicable.
Apart from simplification of the affected drivers this is another step
towards making the flags argument to gpiod_get*() mandatory.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c')
-rw-r--r-- | drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c b/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c index 9974a37a11af..6a1b6a89a928 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c @@ -285,15 +285,14 @@ static int lb035q02_probe_of(struct spi_device *spi) struct omap_dss_device *in; struct gpio_desc *gpio; - gpio = devm_gpiod_get(&spi->dev, "enable"); + gpio = devm_gpiod_get(&spi->dev, "enable", GPIOD_OUT_LOW); if (IS_ERR(gpio)) { dev_err(&spi->dev, "failed to parse enable gpio\n"); return PTR_ERR(gpio); - } else { - gpiod_direction_output(gpio, 0); - ddata->enable_gpio = gpio; } + ddata->enable_gpio = gpio; + ddata->backlight_gpio = -ENOENT; in = omapdss_of_find_source_for_first_ep(node); |