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 11:41:53 +0200 |
commit | ca8c67dafdb7eb543015f1f84bb73f4454e41ca6 (patch) | |
tree | 517e5e5eae5e4ef3c2711ebba98796f8847ebefd /drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c | |
parent | video: fbdev: geode gxfb: use ioremap_wc() for framebuffer (diff) | |
download | linux-ca8c67dafdb7eb543015f1f84bb73f4454e41ca6.tar.xz linux-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-sharp-ls037v7dw01.c')
-rw-r--r-- | drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c b/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c index eae263702964..abfd1f6e3327 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c @@ -268,17 +268,12 @@ static int sharp_ls_get_gpio_of(struct device *dev, int index, int val, const char *desc, struct gpio_desc **gpiod) { struct gpio_desc *gd; - int r; *gpiod = NULL; - gd = devm_gpiod_get_index(dev, desc, index); + gd = devm_gpiod_get_index(dev, desc, index, GPIOD_OUT_LOW); if (IS_ERR(gd)) - return PTR_ERR(gd) == -ENOENT ? 0 : PTR_ERR(gd); - - r = gpiod_direction_output(gd, val); - if (r) - return r; + return PTR_ERR(gd); *gpiod = gd; return 0; |