Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2179569rwb; Mon, 7 Nov 2022 10:04:44 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Eg+Lanpb6du+x7SN88SPDZD5vntsKVTV3W7UnAYfEOEDGhzlTciBiHm2B/Z5mF3zrOL2Q X-Received: by 2002:a05:6402:518a:b0:464:5ec3:c5a with SMTP id q10-20020a056402518a00b004645ec30c5amr20581547edd.90.1667844284422; Mon, 07 Nov 2022 10:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667844284; cv=none; d=google.com; s=arc-20160816; b=1BRkelgrIrAVJ00Xy8JXwApeXyjlU4ZtA2JU+jzgz9ec6B2Ejx3MGWaqdq2j1tqeHs XmLnW4Nnmk/gu4KsoeJ4CNCMXP5nEpSzkAioVg6jQ7YganwkfesN4THHSailVuMOAqcX Ji7qxvJsie6CTz/IFyxptE9IDOx3OtVg7dxb5/vNeT4kcScUqUu1AKxXCaFCXdL77Su7 4oJ/PZ7Pf242FLgwXfwnI8axMI/LKNf48GgdvSrTICg4/PRRotcKK2uYYmdDFZaWlwwM 359Avk3lTMF5M1wVwdZ7BAkyVs/PcGStSJukhYwpq4FdRars0N62gLX23I7mrANp+sV+ /igQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LJrez2HgHsu1m6pMalZRo52s3LhdGvl2oAnXej4fda4=; b=XE1IBCvziolzngnqq5WT7s5grzUOKPbpdVjL8PPCQE5hVWmdyrGa9QptDWL9qmrQ8t yys6zQslVJ/QaaBZYAD3fA98GkLX6jiQNQ0RzLsqrQeJMJae2rPZLe39xdJyKZdISru9 /P97Xho9MIzAWD6Nh6S4ZWc0kKbHyZ9NqEjblNRsmDlCgaNIp8o4BNppmyf3PYkloqFg xKKn75uXUTkmqsipAcm/8oO75AQHfqS8Wl+yNRTv5YkzeFtaTCk5MLN2TWvx73+kFBq8 ospP1TpMTbE5jj1r783inWRhoMG7/98ChAsxC1A59PjDM7uiNaIJugiNoHCrTXt38ibk Z8hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=J47Eo1Wi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp20-20020a1709073e1400b0073da4a0f01csi10059484ejc.743.2022.11.07.10.04.21; Mon, 07 Nov 2022 10:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=J47Eo1Wi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232372AbiKGRwi (ORCPT + 92 others); Mon, 7 Nov 2022 12:52:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232466AbiKGRwW (ORCPT ); Mon, 7 Nov 2022 12:52:22 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B320248F0 for ; Mon, 7 Nov 2022 09:52:02 -0800 (PST) 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Marek Vasut , Stefan Agner , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org 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 Content-Transfer-Encoding: 8bit X-Spam: Yes X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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), }, }; -- 2.35.1