Skip to contentSkip to conversation

drm/panel: simple: Remove unneeded gpiod NULL check

PATCH Applied Fabio Estevam 2 participants 2 messages Jul 17, 2017 – Aug 18, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panel: simple: Remove unneeded gpiod NULL check

From: Fabio Estevam <[email protected]>

The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver.

---
 drivers/gpu/drm/panel/panel-simple.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/panel/panel-simple.c +2 -4
index 474fa75..8c0d6a6 100644
@@ -187,8 +187,7 @@ static int panel_simple_unprepare(struct drm_panel *panel)
 	if (!p->prepared)
 		return 0;
 
-	if (p->enable_gpio)
-		gpiod_set_value_cansleep(p->enable_gpio, 0);
+	gpiod_set_value_cansleep(p->enable_gpio, 0);
 
 	regulator_disable(p->supply);
 
@@ -214,8 +213,7 @@ static int panel_simple_prepare(struct drm_panel *panel)
 		return err;
 	}
 
-	if (p->enable_gpio)
-		gpiod_set_value_cansleep(p->enable_gpio, 1);
+	gpiod_set_value_cansleep(p->enable_gpio, 1);
 
 	if (p->desc->delay.prepare)
 		msleep(p->desc->delay.prepare);
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver.

---
 drivers/gpu/drm/panel/panel-simple.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied to drm-misc-next, thanks.

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel