mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/fsl-dcu: remove unnecessary NULL checks
@ 2024-02-29 18:14 Bjorn Helgaas
  0 siblings, 0 replies; only message in thread
From: Bjorn Helgaas @ 2024-02-29 18:14 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: Stefan Agner, Alison Wang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, dri-devel, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.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@google.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-29 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 18:14 [PATCH] drm/fsl-dcu: remove unnecessary NULL checks Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®