Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp618420pxk; Thu, 3 Sep 2020 08:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLzB3Pf5gstqLx+1DSPN5gXtfvyOu9ILmTVEokpYZKga9jOTLARoTS5Qvq+sgsWvuVmvrF X-Received: by 2002:a17:907:72cc:: with SMTP id du12mr2649414ejc.150.1599146540184; Thu, 03 Sep 2020 08:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599146540; cv=none; d=google.com; s=arc-20160816; b=Jljc68yGOPyFyOaN0zUFuxNF0KXMwRehFRc013iZ6bqk8fpDMxzFGCckCR8Ph9+KOt n2Zur5QreLZDEy8bdZOicNpGKhxQBwRiVxyht7fK5zZvtiltgGXsr3jaOE5UjsUca04g 33nhJUPIxtdv8TiCvh7NtonoIk7xvS6ueD8HPQIKey/gVuRWHK9UTXvk/G5COQaBUPlQ wjyHkNKhTKjlzT2M/6kZpRzlB5qe45nmHOynnqOHvKn1iTdcPham4BCH12zCxp0CSF5m xiKAeSN2mHzE+TaF6wSfCYf9GFx91VhjnkIUiJolxPK0fXeETBJOc4aiskZy27WKYOIK WOmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7SglRxexWR02Jo1xu/7HEB4Hand1VF9eBKwwkPhycx4=; b=Kt7R10ukIQ0fw7EyREhHdzks8tGpQeQJqyvAN1DG4te93x8/EumaMpID4A8LW5TxMJ g6ZOquhUR3kzpIV+1PJpeaVOb9PhRtFU+cZqgMOeuWqJQ6U0e0yyqx9z59BRBxmWUTyV ocqE+/xC5jBsBU7RtasOX8Iijsse/3mH1NC65SLuHuahECLp2n+QCuKgTcIuqplISw23 XWmhCcoDCv7NTZ8fmB25io0IVnVetsVPuQzxTn6mp+0J+h/Ae69Yom9yPkTObFXFX569 HIC7lYR9Ub1B6oRxgsWHMOyTfvrJPO5BTioxb7VimIl3gnJssHh+2mVmKKvs+vuk2XHF DSrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b="n/sywxZY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s22si1772968edc.481.2020.09.03.08.21.57; Thu, 03 Sep 2020 08:22:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b="n/sywxZY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728713AbgICPTS (ORCPT + 99 others); Thu, 3 Sep 2020 11:19:18 -0400 Received: from crapouillou.net ([89.234.176.41]:51236 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbgICL3k (ORCPT ); Thu, 3 Sep 2020 07:29:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132373; 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=7SglRxexWR02Jo1xu/7HEB4Hand1VF9eBKwwkPhycx4=; b=n/sywxZY3LJtrLFp8PyB9RN3P2+He4kBjU2FJO06S1MBNfZGpYeWilBBTEMOjlEaFWtiZ7 7+Ib+m2BtC4kB4qLGttVnuTJ2wEP39qmEVeu84HaiZS2RzTpmQqeZVA4iC5i+7XqqEHHpF Nx7ZrNzJXJg0TMCBkuHfpsdNb/Cp408= From: Paul Cercueil To: Greg Kroah-Hartman , Peter Chen , Cristian Birsan , Felipe Balbi , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Alan Stern , Tony Prisk , Bin Liu , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, openbmc@lists.ozlabs.org, Paul Cercueil Subject: [PATCH 04/20] usb/host: ehci-platform: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:38 +0200 Message-Id: <20200903112554.34263-5-paul@crapouillou.net> In-Reply-To: <20200903112554.34263-1-paul@crapouillou.net> References: <20200903112554.34263-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the newly introduced pm_ptr() macro, and mark the suspend/resume functions __maybe_unused. These functions can then be moved outside the CONFIG_PM_SUSPEND block, and the compiler can then process them and detect build failures independently of the config. If unused, they will simply be discarded by the compiler. Signed-off-by: Paul Cercueil --- drivers/usb/host/ehci-platform.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 006c4f6188a5..4585a3a24678 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -410,8 +410,7 @@ static int ehci_platform_remove(struct platform_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int ehci_platform_suspend(struct device *dev) +static int __maybe_unused ehci_platform_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ehci_pdata *pdata = dev_get_platdata(dev); @@ -433,7 +432,7 @@ static int ehci_platform_suspend(struct device *dev) return ret; } -static int ehci_platform_resume(struct device *dev) +static int __maybe_unused ehci_platform_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ehci_pdata *pdata = dev_get_platdata(dev); @@ -464,7 +463,6 @@ static int ehci_platform_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct of_device_id vt8500_ehci_ids[] = { { .compatible = "via,vt8500-ehci", }, @@ -499,7 +497,7 @@ static struct platform_driver ehci_platform_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ehci-platform", - .pm = &ehci_platform_pm_ops, + .pm = pm_ptr(&ehci_platform_pm_ops), .of_match_table = vt8500_ehci_ids, .acpi_match_table = ACPI_PTR(ehci_acpi_match), } -- 2.28.0