Skip to contentSkip to conversation

drm/panel: lvds: Drop unnecessary NULL pointer checks for lvds->enable_gpio

PATCH New Liu Ying 1 participant 1 message Apr 20, 2021

Subsystems (4)
lore
Share & tools
lore

Liu Ying

author
#0 lore raw

PATCH 1/1 drm/panel: lvds: Drop unnecessary NULL pointer checks for lvds->enable_gpio

gpiod_set_value_cansleep() does NULL pointer check for passed in gpio descriptor's pointer, so it's unnecessary to do that check before calling that function. This patch drops those checks from this panel driver.

Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/panel/panel-lvds.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/panel/panel-lvds.c +2 -4
index 59a8d99..19f11fa 100644
@@ -50,8 +50,7 @@ static int panel_lvds_unprepare(struct drm_panel *panel)
 {
 	struct panel_lvds *lvds = to_panel_lvds(panel);
 
-	if (lvds->enable_gpio)
-		gpiod_set_value_cansleep(lvds->enable_gpio, 0);
+	gpiod_set_value_cansleep(lvds->enable_gpio, 0);
 
 	if (lvds->supply)
 		regulator_disable(lvds->supply);
@@ -74,8 +73,7 @@ static int panel_lvds_prepare(struct drm_panel *panel)
 		}
 	}
 
-	if (lvds->enable_gpio)
-		gpiod_set_value_cansleep(lvds->enable_gpio, 1);
+	gpiod_set_value_cansleep(lvds->enable_gpio, 1);
 
 	return 0;
 }
Signature · 6 lines
2.7.4

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