[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190906192344.223694-4-ddavenport@chromium.org>
Date: Fri, 6 Sep 2019 13:23:42 -0600
From: Drew Davenport <ddavenport@...omium.org>
To: dri-devel@...ts.freedesktop.org
Cc: Drew Davenport <ddavenport@...omium.org>,
Sean Paul <sean@...rly.run>,
Jayant Shekhar <jshekhar@...eaurora.org>,
Bruce Wang <bzwang@...omium.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
Jeykumar Sankaran <jsanka@...eaurora.org>,
Jordan Crouse <jcrouse@...eaurora.org>,
Rob Clark <robdclark@...il.com>,
David Airlie <airlied@...ux.ie>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sravanthi Kollukuduru <skolluku@...eaurora.org>,
freedreno@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>
Subject: [PATCH 4/6] drm/msm/dpu: Remove unnecessary NULL checks
drm_crtc.dev will never be NULL, so no need to check it.
Signed-off-by: Drew Davenport <ddavenport@...omium.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 5 -----
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 +++---
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 094d74635fb7..839887a3a80c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -33,11 +33,6 @@ static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)
{
struct msm_drm_private *priv;
- if (!crtc->dev) {
- DPU_ERROR("invalid device\n");
- return NULL;
- }
-
priv = crtc->dev->dev_private;
if (!priv->kms) {
DPU_ERROR("invalid kms\n");
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index ead7d657097c..0b9dc042d2e2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -266,7 +266,7 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc *crtc)
{
struct drm_encoder *encoder;
- if (!crtc || !crtc->dev) {
+ if (!crtc) {
DPU_ERROR("invalid crtc\n");
return INTF_MODE_NONE;
}
@@ -694,7 +694,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc,
unsigned long flags;
bool release_bandwidth = false;
- if (!crtc || !crtc->dev || !crtc->state) {
+ if (!crtc || !crtc->state) {
DPU_ERROR("invalid crtc\n");
return;
}
@@ -766,7 +766,7 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
struct msm_drm_private *priv;
bool request_bandwidth;
- if (!crtc || !crtc->dev) {
+ if (!crtc) {
DPU_ERROR("invalid crtc\n");
return;
}
--
2.20.1
Powered by blists - more mailing lists