[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240229181404.352531-1-helgaas@kernel.org>
Date: Thu, 29 Feb 2024 12:14:04 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Cc: Stefan Agner <stefan@...er.ch>,
Alison Wang <alison.wang@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: [PATCH] drm/fsl-dcu: remove unnecessary NULL checks
From: Bjorn Helgaas <bhelgaas@...gle.com>
The power management callbacks are never called unless .probe() has already
returned success, which means it has set drvdata to a non-NULL pointer, so
"dev" can never be NULL in the other callbacks.
Remove the unnecessary checks.
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
---
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index ab6c0c6cd0e2..ca23a2ca16bb 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -170,9 +170,6 @@ static int fsl_dcu_drm_pm_suspend(struct device *dev)
struct fsl_dcu_drm_device *fsl_dev = dev_get_drvdata(dev);
int ret;
- if (!fsl_dev)
- return 0;
-
disable_irq(fsl_dev->irq);
ret = drm_mode_config_helper_suspend(fsl_dev->drm);
@@ -191,9 +188,6 @@ static int fsl_dcu_drm_pm_resume(struct device *dev)
struct fsl_dcu_drm_device *fsl_dev = dev_get_drvdata(dev);
int ret;
- if (!fsl_dev)
- return 0;
-
ret = clk_prepare_enable(fsl_dev->clk);
if (ret < 0) {
dev_err(dev, "failed to enable dcu clk\n");
--
2.34.1
Powered by blists - more mailing lists