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>
This commit is contained in:
parent
7f496cfd6b
commit
ef1ea03d75
|
@ -83,8 +83,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
|
||||||
if (r)
|
if (r)
|
||||||
return 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))
|
if (gpio_is_valid(ddata->backlight_gpio))
|
||||||
gpio_set_value_cansleep(ddata->backlight_gpio, 1);
|
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))
|
if (gpio_is_valid(ddata->backlight_gpio))
|
||||||
gpio_set_value_cansleep(ddata->backlight_gpio, 0);
|
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);
|
in->ops.dpi->disable(in);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue