Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1314261rwb; Tue, 29 Nov 2022 11:46:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4sTBmrk6m7UTnyB6jMCQuT3p3m3WLsjU7YMWINSK7eBkh+OiOJYd/v3RShEhSam3JAy9mJ X-Received: by 2002:a17:90a:d3ca:b0:218:95ae:a4b5 with SMTP id d10-20020a17090ad3ca00b0021895aea4b5mr51885058pjw.126.1669751201905; Tue, 29 Nov 2022 11:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669751201; cv=none; d=google.com; s=arc-20160816; b=FQ7bUnEex8Mt5YV75mKL/IPcT9XK0PHt+KbUWLiG3VqfqhpAfcQZEUmf4SdNH1I9LK 1rT6YUpzDvSCXMxtp3V8YfLEtp5UW42VaYQTyg+sYyed2zfHLFbr8b2UyN7ff319ngMq ng/YfULFL/Bkyp+orCj6ilMeU7OqE7wkgb6h/mpUJhvFKh5qJTRoLpOdnsPULhfhfuff UcTjj7r/AygsrhqLVErVuExEmkM2CWZuXLkLWjMeDBq5wplc52F7Ayjhftu3mJksSwFc HHa+uZ4e0waV0COYtp+dNdzvEubyibKG5XuKs2qtuCd4eP1B3v1qW4aQtw4+N6JgtasJ R7CA== 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=3xhXji4Y+jhqcOTFhwZwVtyTneAtmSmQbVx8ey6pfJQ=; b=NLPq4t07rhazoB9dpGbo5pV4ERoDr6AH+UCuaIVwCTwhlhEEWKOfEW159KjibIWwYA SJkqt90x4PM9MtMj+cbHK78m2D7mS8N+AkwN28dns4PsAHRlxLx8ar7c53jJOyotiYEB 6ukKfo4vB2uulSdy02gU0ShQ7KyoKg+OOsWuU00tYun2/eKny/ZW7yU5cUnKmLUmanlQ w48mGQDkRLNB7/K0OQRq5vP9vJzyWvS/ZY49eK+Lhh7C1uwboicfnjPsOGGBCGQDg0l8 LiftVBTTku71K+uxuSsiFd1zl/glloVR/4OjB5EUTedJFV+uSbcdFlQxxHHzIYkEmH9V uI6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=SzUFz0Xt; 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 k16-20020a635a50000000b0047757685d7esi16164524pgm.772.2022.11.29.11.46.31; Tue, 29 Nov 2022 11:46:41 -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=SzUFz0Xt; 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 S236937AbiK2TXf (ORCPT + 84 others); Tue, 29 Nov 2022 14:23:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236950AbiK2TXI (ORCPT ); Tue, 29 Nov 2022 14:23:08 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A939871F34; Tue, 29 Nov 2022 11:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1669749604; 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=3xhXji4Y+jhqcOTFhwZwVtyTneAtmSmQbVx8ey6pfJQ=; b=SzUFz0XtJ4YpefbdR3mI5Ff+SUtGRV9becw/4NPtLVcjWh8MC+kmiDcXNcTSfqfOewQXiC gr+XKa4d+90PNCZg3w+KQL1jDRL6p0VMl1jJMvg/+AvpugtlnsjvCZ2oSfK/MmKah7Fw0V 4LA1jwFn+vpghGDsuax9H3egmlUy2iA= From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org Subject: [PATCH v2 20/26] drm: tegra: Remove #ifdef guards for PM related functions Date: Tue, 29 Nov 2022 19:19:36 +0000 Message-Id: <20221129191942.138244-7-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-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 RUNTIME_PM_OPS() and pm_ptr() macros to handle the .runtime_suspend/.runtime_resume callbacks. These macros allow the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM 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: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org --- drivers/gpu/drm/tegra/dpaux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 7dc681e2ee90..3c84e73d5051 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c @@ -598,7 +598,6 @@ static int tegra_dpaux_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM static int tegra_dpaux_suspend(struct device *dev) { struct tegra_dpaux *dpaux = dev_get_drvdata(dev); @@ -657,10 +656,9 @@ static int tegra_dpaux_resume(struct device *dev) clk_disable_unprepare(dpaux->clk); return err; } -#endif static const struct dev_pm_ops tegra_dpaux_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_dpaux_suspend, tegra_dpaux_resume, NULL) + RUNTIME_PM_OPS(tegra_dpaux_suspend, tegra_dpaux_resume, NULL) }; static const struct tegra_dpaux_soc tegra124_dpaux_soc = { @@ -694,7 +692,7 @@ struct platform_driver tegra_dpaux_driver = { .driver = { .name = "tegra-dpaux", .of_match_table = tegra_dpaux_of_match, - .pm = &tegra_dpaux_pm_ops, + .pm = pm_ptr(&tegra_dpaux_pm_ops), }, .probe = tegra_dpaux_probe, .remove = tegra_dpaux_remove, -- 2.35.1