Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp618798pxk; Thu, 3 Sep 2020 08:22:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6Ft81D6Ip9s4emoIyROaTxUv78RwVJGBMF9ejusW7o9q/2cXyDiRlPzMsDYTfgBX2VLjH X-Received: by 2002:a17:906:274d:: with SMTP id a13mr2837276ejd.434.1599146578105; Thu, 03 Sep 2020 08:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599146578; cv=none; d=google.com; s=arc-20160816; b=qf198Wb1nXVHnf67ckKzDCnwbJeKZTsrQB081sBZFuKQTvqOQ36ysFFRFxRPQaPRXY QzfHdSwISsnH6WoiYpUlsdJFjw61y4emnKhSjdqxx+vCEC7f6sj3Yp1C6YwJrbE11CUm BCKHGvaf+AhXRI79EQBEyTgKyH3PO4GtkS+vs0VXmH424vtQdTm8dgr86PrlYlrkkLOX MA8wYbGv0EuZs/+IEDJSkXNdt+sySTGK552jb5HF5550gbBPfdHsn4v/Pg0gb8JBeb7D 63XSRRviwUaWEyaQAbFP4SlV3mYTf6pgLkHr7AkhffoRowVq67LsTFg/sxGh1IUMf0kG ZZSg== 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=x3OFdNgDOF418fBVzdMohbSbtTKgDO7T8r5jfdzMW+Y=; b=y3muJySvTyxQWokXcDRcKiI81wI01Yk0GMK927N54e8XSjd7AoH/Lrnk6xUCgfOxlT e6DKzHbgA3jIxAZRFhldAeKzPWpAn7gKWDD0pQBOCf+quLm4mxWZzJGbBUlDyqpYt7/L QHvpo+NYSOreZlQZAkF6gYotD50aXRqeqp3SWXAzOVHUZcFNUSZRNbLbSBWxb/a7OuSf boxTT0cDegWL2I6GaHADnAPnG9hgY2xVNAC6M0JAwSiXaUzE5BVPTQhPM59l9TdSDSLz OUTDjmEOEbBeqwGs029w9ElMoMGZj56HY/bk9ttUzvolq3AEdtFgRZLK5lt1vtOR97rr e9mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=cZdEy8G+; 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 oq7si2310245ejb.575.2020.09.03.08.22.34; Thu, 03 Sep 2020 08:22:58 -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=cZdEy8G+; 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 S1728950AbgICPT4 (ORCPT + 99 others); Thu, 3 Sep 2020 11:19:56 -0400 Received: from crapouillou.net ([89.234.176.41]:50454 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728500AbgICL1B (ORCPT ); Thu, 3 Sep 2020 07:27:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132368; 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=x3OFdNgDOF418fBVzdMohbSbtTKgDO7T8r5jfdzMW+Y=; b=cZdEy8G+8PzfzbjNeQPWjcgH4RuZLLGYI+UFG+0EM4Os/uxIEVg9VRlPSPIq0MFzGom6gZ xf4dLy8m8gUtlKR5m97mL6G9y/7iwJwSW2++d6wxv8RwkniTcl5k/Tiuz3zY1TYlGlBDPl PtCEqNNndRth3fbZkYtNmah952TlGGE= 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 02/20] usb/host: ehci-spear: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:36 +0200 Message-Id: <20200903112554.34263-3-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-spear.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index add796c78561..3694e450a11a 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -34,8 +34,7 @@ struct spear_ehci { static struct hc_driver __read_mostly ehci_spear_hc_driver; -#ifdef CONFIG_PM_SLEEP -static int ehci_spear_drv_suspend(struct device *dev) +static int __maybe_unused ehci_spear_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); bool do_wakeup = device_may_wakeup(dev); @@ -43,14 +42,13 @@ static int ehci_spear_drv_suspend(struct device *dev) return ehci_suspend(hcd, do_wakeup); } -static int ehci_spear_drv_resume(struct device *dev) +static int __maybe_unused ehci_spear_drv_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); ehci_resume(hcd, false); return 0; } -#endif /* CONFIG_PM_SLEEP */ static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend, ehci_spear_drv_resume); @@ -155,7 +153,7 @@ static struct platform_driver spear_ehci_hcd_driver = { .driver = { .name = "spear-ehci", .bus = &platform_bus_type, - .pm = &ehci_spear_pm_ops, + .pm = pm_ptr(&ehci_spear_pm_ops), .of_match_table = spear_ehci_id_table, } }; -- 2.28.0