From patchwork Mon Nov 7 17:50:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 13034975 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 AA4C1C433FE for ; Mon, 7 Nov 2022 17:52:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9AD2B10E87F; Mon, 7 Nov 2022 17:52:02 +0000 (UTC) Received: from aposti.net (aposti.net [89.234.176.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id C883710E87F for ; Mon, 7 Nov 2022 17:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843479; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LJrez2HgHsu1m6pMalZRo52s3LhdGvl2oAnXej4fda4=; b=J47Eo1Wi/Q1t2923o0dP/gN2S+4ay/NzH0WdM4wgKrdp//vEZWWBiVv/04q+NV1hi5lA2t q4MIkxqOCBvLLlbsN9LwgZuuRB5N5sguM2NvlT5uwsPYw5fE++JGmwzQheJviKXT4RfWLB 3Zaw65BzTAhSwwwqUcqokD/Du3g0ZCk= From: Paul Cercueil To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 07/26] drm: msxfb: Use the dev_pm_ops provided by modeset helper Date: Mon, 7 Nov 2022 17:50:47 +0000 Message-Id: <20221107175106.360578-8-paul@crapouillou.net> In-Reply-To: <20221107175106.360578-1-paul@crapouillou.net> References: <20221107175106.360578-1-paul@crapouillou.net> MIME-Version: 1.0 X-Spam: Yes 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: , Cc: Marek Vasut , Sascha Hauer , linux-kernel@vger.kernel.org, Paul Cercueil , dri-devel@lists.freedesktop.org, Pengutronix Kernel Team , Shawn Guo , linux-arm-kernel@lists.infradead.org, NXP Linux Team Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the drm_mode_config_pm_ops structure exported by drm_modeset_helper.c, which provides the exact same PM callbacks. Signed-off-by: Paul Cercueil --- Cc: Marek Vasut Cc: Stefan Agner Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index b29b332ed381..917ba3bfadcf 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -398,26 +398,6 @@ static void mxsfb_shutdown(struct platform_device *pdev) drm_atomic_helper_shutdown(drm); } -#ifdef CONFIG_PM_SLEEP -static int mxsfb_suspend(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_suspend(drm); -} - -static int mxsfb_resume(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_resume(drm); -} -#endif - -static const struct dev_pm_ops mxsfb_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(mxsfb_suspend, mxsfb_resume) -}; - static struct platform_driver mxsfb_platform_driver = { .probe = mxsfb_probe, .remove = mxsfb_remove, @@ -425,7 +405,7 @@ static struct platform_driver mxsfb_platform_driver = { .driver = { .name = "mxsfb", .of_match_table = mxsfb_dt_ids, - .pm = &mxsfb_pm_ops, + .pm = pm_sleep_ptr(&drm_mode_config_pm_ops), }, };