diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-12-10 16:11:44 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-12-29 12:06:31 +0300 |
commit | ef1ea03d7574273d39b6af49494b02e337992a62 (patch) | |
tree | ea45edb61289b0cc2b5412e776e8847efd69453f /drivers/video | |
parent | 7f496cfd6bd5a74c9cd50252b3a0141709cbf020 (diff) | |
download | linux-ef1ea03d7574273d39b6af49494b02e337992a62.tar.xz |
fbdev: omap2: panel-dpi: simplify gpio setting
gpiod_set_value_cansleep is a noop when the passed descriptor is NULL.
So there is no need to duplicate the check for NULL; just call the
function unconditionally instead.
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')
-rw-r--r-- | drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c index 06b6e611e4b2..e780fd4f8b46 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c @@ -83,8 +83,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) if (r) return r; - if (ddata->enable_gpio) - gpiod_set_value_cansleep(ddata->enable_gpio, 1); + gpiod_set_value_cansleep(ddata->enable_gpio, 1); if (gpio_is_valid(ddata->backlight_gpio)) gpio_set_value_cansleep(ddata->backlight_gpio, 1); @@ -105,8 +104,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) if (gpio_is_valid(ddata->backlight_gpio)) gpio_set_value_cansleep(ddata->backlight_gpio, 0); - if (ddata->enable_gpio) - gpiod_set_value_cansleep(ddata->enable_gpio, 0); + gpiod_set_value_cansleep(ddata->enable_gpio, 0); in->ops.dpi->disable(in); |