From patchwork Mon Nov 7 17:52:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 16615 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2201903wru; Mon, 7 Nov 2022 09:56:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM4K9otj9wqqeMnudZWae2Nb8CRiIxMaCPca5WjbJHx4nJFE4i5w0A/0W54OmyQ0jop436Yh X-Received: by 2002:a17:90a:6c25:b0:212:d909:a41e with SMTP id x34-20020a17090a6c2500b00212d909a41emr850505pjj.48.1667843802771; Mon, 07 Nov 2022 09:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667843802; cv=none; d=google.com; s=arc-20160816; b=NJ5Pi4QaSN9kkiRlQR5vgQhVxXM6Ax3l5hngzGoN5x3VhjlcqsK9HlcKQR9P2JDjV6 i4Bbxd/i+AORggxoFBYFBZcdwHnhgCx1Qy88mKBJTkduI71sVYUAw8Ue+iwswv35zkcF O8ywLDzjolBTuWL3ehA9CyejrDanuhNXE0YtpbB5tFqZN3NE/EMloSQlIzkLAESYlhBQ Z1FXEe+99XMhIJZQr0DksWG+xZiYbHrlKQ/c/aYx+kjTP36CXWqX/k0hr0D/mYvmuCbT t0OeeNvnwJJu7UNi1owgfP22h8i7c8KrYEEyvn88/yEQf2tfLUhTpzcomfUZUuukjeE+ XJ3w== 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=H8pAyOlP7Xx5OwjiRIaFlkfD4bNit3L8bl0IUhfSO6I=; b=DxOWzqJUPPf89q1KDgoGDdejAODP219A7OpgUafzPtGrXwCmm74nUekan/78fLY73r FrCFB8W6ex7A9BdzId8+kF4ghWIrAdnO2Z153xsLQ2BKn2+UhURdFUP2mLPN8+ikaBKW gxNqQl8y2ACcQ2i76uU7v6S3q3MdPy/8ZZ/2POS+SUgOqbdNOdgdCiGZ7sMOCbznn6Ar JHtgh7pQTXla+Dnkjn7J/58Z8b/JSMDtjJTbEbXeBSS85dYM7P3CY4ZtkQAY612yNdtn OQE815Rn5knHUf48bbLVaqg7XjEq7tdBwkOwdmrodkD/cWwX/JiCUP7+oU2Clfwlxvn/ FYCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qsyxCgN0; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a170902d4ca00b00182d09b284dsi12772561plg.310.2022.11.07.09.56.29; Mon, 07 Nov 2022 09:56:42 -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=qsyxCgN0; 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 S232981AbiKGR4D (ORCPT + 99 others); Mon, 7 Nov 2022 12:56:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232681AbiKGRya (ORCPT ); Mon, 7 Nov 2022 12:54:30 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CEB22539 for ; Mon, 7 Nov 2022 09:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843592; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8pAyOlP7Xx5OwjiRIaFlkfD4bNit3L8bl0IUhfSO6I=; b=qsyxCgN0sN+ARh1+P1h+1FIkwlPwMd4Ug9gjGO+OK/xM3oPoWKF4SwUC9zdgEu0+UZk+7a HcyfcQ0Rkg6+Nb8IU7mPqnwdzz40vRFn1HYCsiYVDidekFLfuRB3IyRWFoWpIB+TXFlz9G /BuGBtZVO03djzY3tdYyK7MoVCOTFtU= 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 , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 18/26] drm: rockchip: Remove #ifdef guards for PM related functions Date: Mon, 7 Nov 2022 17:52:48 +0000 Message-Id: <20221107175256.360839-8-paul@crapouillou.net> In-Reply-To: <20221107175256.360839-1-paul@crapouillou.net> References: <20221107175106.360578-1-paul@crapouillou.net> <20221107175256.360839-1-paul@crapouillou.net> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748860983457448068?= X-GMAIL-MSGID: =?utf-8?q?1748860983457448068?= Use the pm_sleep_ptr() macros to handle the .suspend_late / .resume_early callbacks. This macro allows the suspend and resume functions to be automatically dropped by the compiler when CONFIG_SUSPEND is disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil --- Cc: Sandy Huang Cc: "Heiko Stübner" Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index ad2d3ae7e621..0df0fa540d7e 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -429,7 +429,6 @@ static int rockchip_dp_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int rockchip_dp_suspend(struct device *dev) { struct rockchip_dp_device *dp = dev_get_drvdata(dev); @@ -449,13 +448,10 @@ static int rockchip_dp_resume(struct device *dev) return analogix_dp_resume(dp->adp); } -#endif static const struct dev_pm_ops rockchip_dp_pm_ops = { -#ifdef CONFIG_PM_SLEEP .suspend_late = rockchip_dp_suspend, .resume_early = rockchip_dp_resume, -#endif }; static const struct rockchip_dp_chip_data rk3399_edp = { @@ -484,7 +480,7 @@ struct platform_driver rockchip_dp_driver = { .remove = rockchip_dp_remove, .driver = { .name = "rockchip-dp", - .pm = &rockchip_dp_pm_ops, + .pm = pm_sleep_ptr(&rockchip_dp_pm_ops), .of_match_table = rockchip_dp_dt_ids, }, };