From patchwork Thu Feb 29 18:14:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13577508 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6EBB5C48BF6 for ; Thu, 29 Feb 2024 18:14:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B72E10E58E; Thu, 29 Feb 2024 18:14:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="IgwLOh3/"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 18C2310E4A3 for ; Thu, 29 Feb 2024 18:14:09 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 58D1660DE7; Thu, 29 Feb 2024 18:14:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90F53C433F1; Thu, 29 Feb 2024 18:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709230447; bh=puQJBrcPK5Z3RCYzqNZihfMO0Tg5uf4iB/iw30xgVpg=; h=From:To:Cc:Subject:Date:From; b=IgwLOh3/lmwXC0mbjV854Af52B9itc20DwBDBtiL+ZCpBmeB/rhY7uPTW9t45066c u760pkPWHfLKADi2HRS1Lm2VzYNXbbYQ5n2FK2cfgJpJMWgU4blPaYQWINfPCncMsg RtOAAGd5AaIT8CAw7W9z8AEon1NtdPyptUww6kaibhwSpX2SPWIUC+etomWPM0q3bV jyrdVowQI3n6qBOJAHnRM+HqyKMQ6vz9vBMOAlwFOseItcTwtMvcNgGksBvhOC4Azm tdOJlS+CdFLB9eWTe1xRX41UPYh8oRiYFuwU6dd/LqTng83HNykivVnnEvdR2Ld27e RaWr2REeoswMA== From: Bjorn Helgaas To: David Airlie , Daniel Vetter Cc: Stefan Agner , Alison Wang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH] drm/fsl-dcu: remove unnecessary NULL checks Date: Thu, 29 Feb 2024 12:14:04 -0600 Message-Id: <20240229181404.352531-1-helgaas@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Bjorn Helgaas 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 --- 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");