Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1347598rwb; Tue, 29 Nov 2022 12:16:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf5OnvR4n8D4lEjDOM7Y2qPxGcEZuAY6c8XHheSMXXdFiVVMo0ddtjVvrXJ43FVKjwlf3lJa X-Received: by 2002:a17:906:39cf:b0:7c0:9875:42d1 with SMTP id i15-20020a17090639cf00b007c0987542d1mr1278734eje.310.1669752987662; Tue, 29 Nov 2022 12:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669752987; cv=none; d=google.com; s=arc-20160816; b=EpFCzB65vsh3Q9r6ZeEEkU1A5pofvkFjh/Z7IJcjbXHqgXxl0UMx4uswfeFU6QV3v7 DVvM/xSdjE3k2p1gz3qHSAwJiKFJu87e0DKDcgcBB1BCRTxo0aayD3z0zxEoa+1RFvyh bSbULDLqixc8KdIlSWepV682gUhKFR8JCY3mqBXduw2ZSlaRRsEoAXIaJl/6ArDUPajO 6086GRmhcu+4tEbm+YORyJWWG7QGVLTdIPn4dQO9vXsucpzCI32+ufLcHLLlzeDuLDv4 vQ1TsSMds1ZqMmLf/RyWDX9+PQmUGtk7CZ3OvP0hAl7UF5bSWUnSLKajCjR8ZQnjgco/ YrZw== 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=M1RX/ZzdghYIWu8xoGXfoZAVlUhjaMzV0pc+gin64as=; b=mb/0wvN6IWD2PTWYTjH4BDQxG1xXAJO4aVoTBKHuUOc0jTzg49yQ3u6gxPVMys5WJs MpojSmkaeVhu7N5v2dmnALO1fCpLZK+LlXjeEppmMp/2hZUlcnFRuMFZ/TyqpYozgS1/ rqa1NMbqJ7eOuNOo1rd9v1LnpXaU9MqtzjqzrxPM/QysNNvr23B56O6i9XW7LoTENctp KJv1tYF3B4ziqMi9g3KOhnADEhdHO9WF33JK+ugGzGFfzuNUa//e0WWTK03j4jwTq5aG 7ndm57GpfVUaN0XuzO2+fHbWvuPLSmEHJzkMzr1YG8eVx5+JBzk5h9CK4GiN963YQWDu y/Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=3OHE2ic0; 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 rh16-20020a17090720f000b007aea2b23ee3si10428476ejb.277.2022.11.29.12.16.06; Tue, 29 Nov 2022 12:16:27 -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=3OHE2ic0; 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 S236854AbiK2TYu (ORCPT + 84 others); Tue, 29 Nov 2022 14:24:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236850AbiK2TYU (ORCPT ); Tue, 29 Nov 2022 14:24:20 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C24B6D4A2 for ; Tue, 29 Nov 2022 11:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1669749650; 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=M1RX/ZzdghYIWu8xoGXfoZAVlUhjaMzV0pc+gin64as=; b=3OHE2ic0oVpFuxqPpyT/Mdaw8vhcmHTmDgShalr2vdOMtgU5/1cDtGIHY/R3cgU4ilZQ05 rXDgQkFqIejTG6ONSv2LH+xtVA0yM0dFxPgd18IEAU4J2zBcSUjXjRi0UoEvPITs32F0vv UKHgf7gGZwN2SbUobuvcqHtqQsSI3Ao= From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Emma Anholt , Maxime Ripard Subject: [PATCH v2 23/26] drm: vc4: Remove #ifdef guards for PM related functions Date: Tue, 29 Nov 2022 19:19:39 +0000 Message-Id: <20221129191942.138244-10-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: Emma Anholt Cc: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_v3d.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index 56abb0d6bc39..6000c7032b92 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -368,7 +368,6 @@ void vc4_v3d_bin_bo_put(struct vc4_dev *vc4) mutex_unlock(&vc4->bin_bo_lock); } -#ifdef CONFIG_PM static int vc4_v3d_runtime_suspend(struct device *dev) { struct vc4_v3d *v3d = dev_get_drvdata(dev); @@ -397,7 +396,6 @@ static int vc4_v3d_runtime_resume(struct device *dev) return 0; } -#endif int vc4_v3d_debugfs_init(struct drm_minor *minor) { @@ -525,7 +523,7 @@ static void vc4_v3d_unbind(struct device *dev, struct device *master, } static const struct dev_pm_ops vc4_v3d_pm_ops = { - SET_RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL) + RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL) }; static const struct component_ops vc4_v3d_ops = { @@ -557,6 +555,6 @@ struct platform_driver vc4_v3d_driver = { .driver = { .name = "vc4_v3d", .of_match_table = vc4_v3d_dt_match, - .pm = &vc4_v3d_pm_ops, + .pm = pm_ptr(&vc4_v3d_pm_ops), }, }; -- 2.35.1