[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1618904840-29078-1-git-send-email-victor.liu@nxp.com>
Date: Tue, 20 Apr 2021 15:47:20 +0800
From: Liu Ying <victor.liu@....com>
To: dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org, linux-imx@....com,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Thierry Reding <thierry.reding@...il.com>,
Sam Ravnborg <sam@...nborg.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>
Subject: [PATCH] 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 <laurent.pinchart@...asonboard.com>
Cc: Thierry Reding <thierry.reding@...il.com>
Cc: Sam Ravnborg <sam@...nborg.org>
Cc: David Airlie <airlied@...ux.ie>
Cc: Daniel Vetter <daniel@...ll.ch>
Signed-off-by: Liu Ying <victor.liu@....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
Powered by blists - more mailing lists