All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: lvds: Drop unnecessary NULL pointer checks for lvds->enable_gpio
@ 2021-04-20  7:47 ` Liu Ying
  0 siblings, 0 replies; 2+ messages in thread
From: Liu Ying @ 2021-04-20  7:47 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, linux-imx, Laurent Pinchart, Thierry Reding,
	Sam Ravnborg, David Airlie, Daniel Vetter

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 <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 59a8d99..19f11fa 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -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;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] drm/panel: lvds: Drop unnecessary NULL pointer checks for lvds->enable_gpio
@ 2021-04-20  7:47 ` Liu Ying
  0 siblings, 0 replies; 2+ messages in thread
From: Liu Ying @ 2021-04-20  7:47 UTC (permalink / raw)
  To: dri-devel
  Cc: David Airlie, linux-kernel, Thierry Reding, Laurent Pinchart,
	Sam Ravnborg, linux-imx

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 <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 59a8d99..19f11fa 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -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;
 }
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-20  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  7:47 [PATCH] drm/panel: lvds: Drop unnecessary NULL pointer checks for lvds->enable_gpio Liu Ying
2021-04-20  7:47 ` Liu Ying

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.