Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2180873rwb; Mon, 7 Nov 2022 10:05:33 -0800 (PST) X-Google-Smtp-Source: AMsMyM5GYEqUu8AvgGAkPmAafqMePZdOi6Dxx6jAJXREUAGSuBBctsoQhLIqV1Q01xv4O4PXEve1 X-Received: by 2002:a17:906:cc49:b0:7ad:93d1:5eaf with SMTP id mm9-20020a170906cc4900b007ad93d15eafmr48846760ejb.393.1667844333155; Mon, 07 Nov 2022 10:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667844333; cv=none; d=google.com; s=arc-20160816; b=uRQDrqiP1Gg56753SlPOPLcWb19MnQjAz1VJxWsFG4JkHKU+R4w8klEMne3lUzMdso ufwhUc+AL2EZfLpSShx96zFiTegu56xDelshXSvNvhVN39SYgZ3zSo5j5saNQKN31xM2 EDY8ychM+vVsflWjJPBZvY71KDmGgk/woTlCcts0Q7AA9VTOVDIlcYcuAJD8lph0T6SH h/VShCwCM+0MZqju5UMeAiu+W5lMjdcap/fz4kf/WGYfejpkAvsY0VSdRjKVAgpjNXVd APdfWIqAGjYIwJNHViMtGq1cETtqaaagAFKCbeS0Ar4qoSOXiRZtypMu3GzFjxdBR50T V75g== 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=v5THks8G5thM8MpzfovKFJFQl1Oz6R2zYzhs11WmEBw=; b=jSE/+wuVz6BK3yIZF8AzJN/QPOIfS6a2n7FKTW90hu3oSPZ1Q7nxzgZaqo3WHP5Rhz GBTgfLjg3+uV4upgS/zf/T6RS6HtWv626Stds5Xuxvq3qK9M1q1t8vJz5jX10iudoB9V JIrOsMiscsKMICo0t93sfRZx9p2QiNnT7wmBUXXfUgFzZyf0zTkpd046evqW1mgVrLQG iGRoC/47VgpHJ7PKYEDML4/h9k1WK1bUPqbEdvhnqOKruowByguwKibCaAxjyxv4Vzwi bQNs5IyYZr+qjvMsdIJ5/Gjc0KDrszdK2PDbNOiCRnKoB/MF+a3Drb8CESreZ3u9M5oV 2MwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=wRUg0fzP; 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 sa32-20020a1709076d2000b0078c39937f73si11435811ejc.798.2022.11.07.10.05.10; Mon, 07 Nov 2022 10:05:33 -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=wRUg0fzP; 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 S232169AbiKGR4k (ORCPT + 92 others); Mon, 7 Nov 2022 12:56:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232637AbiKGRzZ (ORCPT ); Mon, 7 Nov 2022 12:55:25 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1EC424F2C for ; Mon, 7 Nov 2022 09:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843596; 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=v5THks8G5thM8MpzfovKFJFQl1Oz6R2zYzhs11WmEBw=; b=wRUg0fzPYgUjWGRA7Zk51JSJfOFCQz6mEfxbR520rZUbVMVAA9VZ7aYLFyg8knC7zr6j76 d1DpHWTqb9UgGG/9fSsBi4mTOCrep6aKkMc6LhSA2mZBWOFUgwuSUkD+JfcmQnHGtF3KcI BdiFKNvCT3d8He4siopok9nrVSU5bTk= 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 , Hans de Goede Subject: [PATCH 22/26] drm: vboxvideo: Remove #ifdef guards for PM related functions Date: Mon, 7 Nov 2022 17:52:52 +0000 Message-Id: <20221107175256.360839-12-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 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 --- 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 f4f2bd79a7cb..79318441ed7e 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