Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1313079rwb; Tue, 29 Nov 2022 11:45:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5la8V7LRopv7c3H8Fx8+33zCEKuOwwjhABs1GxWEUeh33JHQhR/0dwMJqhBwnLQ+up6L2M X-Received: by 2002:a17:90a:7804:b0:211:2d90:321 with SMTP id w4-20020a17090a780400b002112d900321mr67245031pjk.84.1669751130448; Tue, 29 Nov 2022 11:45:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669751130; cv=none; d=google.com; s=arc-20160816; b=omqpDOp6Eiv0L8NdLaxDHg5scKkzxpadJtPzBLfNoRh59TYjB5SwFuo2Xlzr0kyXm4 DStm0Ges70eb/d1rePdVSMPhUMyJ0y8k8JXvVVEK8wgFcRrcV31OUGIP0xZV8i6hSsKD CPwakmDIvkjJk4e7I7MN4S5z5Q8sPG6abe0Ynf/VkYRxS+lIKRsZwlj5pkBIU4ZtsHG6 MTZ4xi+6h8AMphz/h62sB7zv/wP4L5ABJgUPnuWI46wZgcEkOorYBc3QVTDlAcN0nxsP EQM4uFAJaAGD0EN+U6szN3MdVEeGtlY5zMkHW/ezf/ywJbLAAh2OMuoCygCj5iF1av8P ckgw== 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=z4t/hdHSpbsCzRzZgq9/omU3MCI1W+i6YZT64Xpoef6ADxKLeuED1irZH+nbKNUimA hS2ipwqmrjk4kDVPDAr0eMQaZrrhAYgzcdtOgVcWceC/T24HWDesXu4Wd1LegjccnE0Y QLNj2kksP4SA95M/wXhmib+05EeiXNkX8AuQ8zeIb15acyVl3naoEJHwIKZDm1pPFPB1 kLByQvJwZ8p4lQPF4PAolWwWEl2gTOAH0VPhVREkbQ8WGahMDf3uAkaeu8nOHOPymU3L bCUpPE+IhBYLaX/JLJ0FQCRnFpqET52BG1ej1ThorNQibDPshx5wGjzt/zE5LSqLdusn rqlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=fBnZhqyR; 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 j7-20020a654d47000000b00477bf7b0c43si15549480pgt.458.2022.11.29.11.45.19; Tue, 29 Nov 2022 11:45:30 -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=fBnZhqyR; 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 S236887AbiK2TWn (ORCPT + 84 others); Tue, 29 Nov 2022 14:22:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236885AbiK2TW0 (ORCPT ); Tue, 29 Nov 2022 14:22:26 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82D1E711AE for ; Tue, 29 Nov 2022 11:20:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1669749597; 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=fBnZhqyRpBU0wllYHNSxdl3O5ZI0Y8RmJc/WgRR3TJiIjMleyPmacJVGAA+C32Hi1UTzUv lLHfzqJToeqJ7N5yMQR4iBDjyYcOhepFOfhsaNDHLtSZC79paUVnsanZbtfQeeMYsmiBNF aSIRdqRZRokfvdL0NWxwQmnhdMCPY1c= From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 18/26] drm: rockchip: Remove #ifdef guards for PM related functions Date: Tue, 29 Nov 2022 19:19:34 +0000 Message-Id: <20221129191942.138244-5-paul@crapouillou.net> In-Reply-To: <20221129191942.138244-1-paul@crapouillou.net> References: <20221129191733.137897-1-paul@crapouillou.net> <20221129191942.138244-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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, }, }; -- 2.35.1