Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1349191rwb; Tue, 29 Nov 2022 12:17:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GgMfiBHt/+5huasdRp71hrzRYt7bTAY32fenSScymr/0fgvh/rKr48DVW1ADoJArt4/uy X-Received: by 2002:a17:906:3982:b0:7ad:8bc6:46e7 with SMTP id h2-20020a170906398200b007ad8bc646e7mr52000342eje.28.1669753066375; Tue, 29 Nov 2022 12:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669753066; cv=none; d=google.com; s=arc-20160816; b=Y9MJfe95LznvF4wwIVGFD1CFWzQo0qTtMmBcAJAvgFBDT4q2t4qS6oPdlW9AX2yUUN BIXXKg+OlmXWJXPlxM1gxPXlC3mFhjgI5WLfQXrx3DfW1Na+pgwim38G+qnLR0fqFCnl iEalDE9Eu6cwQGeiRmks97dM7T7wyFjjv6NAToUmY9UQbLJ+ndAMkfKIUjZZ6yT8DDKA sKri4kC3ReS5vjhao/phyh2dWa/8lumllQbvHR69EJRc7pLpxqa9vq8XgVm7BeeCN3Er 7iiTL1M6sDUoe7s2jlt9D79wLgHfqNvfKMlGNe+O/n6mzewK2frY/Pww+oJcQUrYT46l ZgKQ== 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=oLUKcEnShwNV7IAkx5+nlu/qzKUV03wm4WmwUoc45xY=; b=iEmrnX6i3ckw6mCwQ17FVhU8WTbSY5N1Zm5aP1G1oHsxu4QUZKO8K9HOhtMUE7kq01 2FPfNwU938VNs3cVBhtfpIjmELQIkCHRYQDx2ep/aWDdOTp+Kbs81TSGLnA1O/3n53IS F2xtlVVXBZfnRDxTMiZD+xhpOP64V1rKRabtqpaQMNi4e8jT7MMDNdXfPHFbVvxTaF/j aLMSblkm7RGnAMvUCocmc1wV6jjAwDMhxsAp9DyPDkE2ioGyohXLjOThI6TEk+47Ucue WajoXBJG5WF+VivTVbFhx5fjf0IWQC/OB2YoH/YvPlOFNzluEqV+v5qxcAnYTbnajxN+ k6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="bp4LM/hn"; 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 w18-20020a056402129200b00458e689f41fsi1364230edv.415.2022.11.29.12.17.26; Tue, 29 Nov 2022 12:17:46 -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="bp4LM/hn"; 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 S236835AbiK2TYU (ORCPT + 84 others); Tue, 29 Nov 2022 14:24:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236819AbiK2TYD (ORCPT ); Tue, 29 Nov 2022 14:24:03 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73D973BB9 for ; Tue, 29 Nov 2022 11:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1669749649; 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=oLUKcEnShwNV7IAkx5+nlu/qzKUV03wm4WmwUoc45xY=; b=bp4LM/hnTnmmZksYmDtegnSOp+dpDcQqJ7cYWG0d53Kykd6HAnVsZIBEFE0th67GKJ4zgN 1nk6AqSG6KFjCyww5de73wVkrFyIrEybywgwbMu6j1rRiGnyDoZKOWNmN749GNqib70kx9 bxa4LwAoIGwlZEerL81uQJ6k549mQMw= From: Paul Cercueil To: David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Hans de Goede Subject: [PATCH v2 22/26] drm: vboxvideo: Remove #ifdef guards for PM related functions Date: Tue, 29 Nov 2022 19:19:38 +0000 Message-Id: <20221129191942.138244-9-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 pm_sleep_ptr() macro to handle the .suspend / .resume 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 Reviewed-by: Hans de Goede --- Cc: Hans de Goede --- drivers/gpu/drm/vboxvideo/vbox_drv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c b/drivers/gpu/drm/vboxvideo/vbox_drv.c index b450f449a3ab..12fee99dbfe8 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_drv.c +++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c @@ -102,7 +102,6 @@ static void vbox_pci_remove(struct pci_dev *pdev) vbox_hw_fini(vbox); } -#ifdef CONFIG_PM_SLEEP static int vbox_pm_suspend(struct device *dev) { struct vbox_private *vbox = dev_get_drvdata(dev); @@ -160,16 +159,13 @@ static const struct dev_pm_ops vbox_pm_ops = { .poweroff = vbox_pm_poweroff, .restore = vbox_pm_resume, }; -#endif static struct pci_driver vbox_pci_driver = { .name = DRIVER_NAME, .id_table = pciidlist, .probe = vbox_pci_probe, .remove = vbox_pci_remove, -#ifdef CONFIG_PM_SLEEP - .driver.pm = &vbox_pm_ops, -#endif + .driver.pm = pm_sleep_ptr(&vbox_pm_ops), }; DEFINE_DRM_GEM_FOPS(vbox_fops); -- 2.35.1