Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2186009rwb; Mon, 7 Nov 2022 10:08:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM7As9JPCJtzjXQ0OEvOInxKxE5JN3p504i6y+gc2cEmYxovMSZ2DXPAumlQikJpP99Pfn+V X-Received: by 2002:a17:907:763b:b0:7aa:1ae6:900b with SMTP id jy27-20020a170907763b00b007aa1ae6900bmr47232413ejc.416.1667844514829; Mon, 07 Nov 2022 10:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667844514; cv=none; d=google.com; s=arc-20160816; b=JsIMmgs2ZhIzYigN6xKP2XfWnXeChcJ5OcqqVZ3msK7I7caTP/YYLA/9c8jLJChzA+ ZrqdbZDkXL/D8K8wVAMX27be7gGSE9UN2+EumSNSmKGsjPp3j6gg0hjT0V8hNVchJlOu zZlZoXaEgOgh8E08x8igXFnndmzr8/LIxNxl9FyfG6sn135DbhgOfpqDVm8/dXentaun Tt8nuhvXqbaQEJll1ownqLNtYGQ/I8qo+X2ZQKQM24KPpaSSpC9yLRuHaDkb1vZy3WAf 5uBVL0ca/UvHOH6TfEzKqfDlo+WTLAwY4GxSIRsVIQ8YxA+w9X/DhGuLtpS4tVM9yYVq lSJQ== 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=5Avu5fJwFdzpUBtBfpMkuNkz3r3lpjviSJgLf/PyNnc=; b=Ygsmj0sm0QE64mhaa+mUf9hKfw7zOUWHfE2P4BTNzPJyH6faf5MElnU9D9Oip/ZjLX 4e4A1atLM63ZxzuBErRl7S7veq0gKZ6AbF9+PtahzU4ZVrUqT4J89ov2RgNLPkuPIuRB UyfdquQAhz6uX5Cz9wotgybXbAXg10l+bwgTShQ8n7z24PVgPWXIP8RO1cjGSp8EDbWk 07SaVCFSkrW/S92Fu8Wl1UJgE143wmn7qGzL0Q4Whcv6Ph04fig3wTfP1CmzEKtdIqnB IzKoIi+GdAItyoeJOzYsKbKAV3dQu2EW9wSopjHQQ3119y/uGiPvHp28LRglvdoRR7us i+vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=huAr+yEh; 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 q11-20020a056402518b00b00460faf7d2a3si11173748edd.277.2022.11.07.10.08.12; Mon, 07 Nov 2022 10:08:34 -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=huAr+yEh; 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 S231587AbiKGR6N (ORCPT + 92 others); Mon, 7 Nov 2022 12:58:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232799AbiKGR5w (ORCPT ); Mon, 7 Nov 2022 12:57:52 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40ECE27B1C for ; Mon, 7 Nov 2022 09:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843718; 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=5Avu5fJwFdzpUBtBfpMkuNkz3r3lpjviSJgLf/PyNnc=; b=huAr+yEhaapVak5VdJsZEjw6FhHlbHjj9cw1yDTXRmmOmWOxokR6MaxcutJxHadCPlfuVU cQyoZBwM561D8HHH6qLIKm0bnyxcUJTKyws3fl8xgPEEtpiAOsO8TBNGrQTxfs6VzdBSrF E6JJBEfpaJGmUU5eTdAzJ+u7c4Cx1sc= 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 24/26] drm: gm12u320: Remove #ifdef guards for PM related functions Date: Mon, 7 Nov 2022 17:55:08 +0000 Message-Id: <20221107175510.361051-1-paul@crapouillou.net> In-Reply-To: <20221107175106.360578-1-paul@crapouillou.net> References: <20221107175106.360578-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_ptr() macro to handle the .suspend / .resume / .reset_resume callbacks. This macro allows 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. It also allows to drop the __maybe_unused tags. Signed-off-by: Paul Cercueil --- Cc: Hans de Goede --- drivers/gpu/drm/tiny/gm12u320.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c index 7441d992a5d7..0a901201142e 100644 --- a/drivers/gpu/drm/tiny/gm12u320.c +++ b/drivers/gpu/drm/tiny/gm12u320.c @@ -4,6 +4,7 @@ */ #include +#include #include #include @@ -718,15 +719,15 @@ static void gm12u320_usb_disconnect(struct usb_interface *interface) drm_atomic_helper_shutdown(dev); } -static __maybe_unused int gm12u320_suspend(struct usb_interface *interface, - pm_message_t message) +static int gm12u320_suspend(struct usb_interface *interface, + pm_message_t message) { struct drm_device *dev = usb_get_intfdata(interface); return drm_mode_config_helper_suspend(dev); } -static __maybe_unused int gm12u320_resume(struct usb_interface *interface) +static int gm12u320_resume(struct usb_interface *interface) { struct drm_device *dev = usb_get_intfdata(interface); struct gm12u320_device *gm12u320 = to_gm12u320(dev); @@ -747,11 +748,9 @@ static struct usb_driver gm12u320_usb_driver = { .probe = gm12u320_usb_probe, .disconnect = gm12u320_usb_disconnect, .id_table = id_table, -#ifdef CONFIG_PM - .suspend = gm12u320_suspend, - .resume = gm12u320_resume, - .reset_resume = gm12u320_resume, -#endif + .suspend = pm_ptr(gm12u320_suspend), + .resume = pm_ptr(gm12u320_resume), + .reset_resume = pm_ptr(gm12u320_resume), }; module_usb_driver(gm12u320_usb_driver); -- 2.35.1