From patchwork Thu Sep 3 11:25:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9739214E5 for ; Thu, 3 Sep 2020 11:31:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 665D92071B for ; Thu, 3 Sep 2020 11:31:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NE5LJqPb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="xsWwAFxu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 665D92071B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C0d5qOE1k93norbzXTwsOyj+b0RP06nWihIW+fi/RRM=; b=NE5LJqPb7t9OZnknQjAVEye03 zS8ITnNHdIcFCcmx7c83IWDlwblETK9CDLHXCgGFBIOAuvDB+usf2BBAj+2WNeygmRpDC0aMgeJmo Q2O5X+untFvGE3KFHhRwFzZ7se2qmbZssH3fiaTlRrb/CzsTsO4J58X7m3oIgprRzhN5o9h7utQw+ YDyCj7JpxHd+YGyrC6P5tWUrUsCblKIXt8USWxrSqYsNCondY8+kZukrDsyohBQNX/gxPftHSCsQM mPluYuOK0CLPkJbTu59tQyO8Wiafuf+YQC9ZIgmMg2En16T8I3DL8f7feEwrpkTGEMm0KOVJIIi7R k3tHpgmgQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnSE-000541-Pn; Thu, 03 Sep 2020 11:30:58 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPw-0003co-Tp for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:28:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132413; 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=J6Cjz5sekpGDn1rcuBCLu89HY0vBE+cfODvggh6BD5M=; b=xsWwAFxugGWyD41I1noG8j49pGiP3DmP8Z0Ib/Oi1o/eDGTRpVibfAeZIg7DS9Fqfq8T1l TLZAlUHAAu9Mt135JM9yq5oOklHHDyG+kTom6DdpcL7oLHxESfAvghnKS/w/Y/+C6njNeI 3eppN8IzlKc75vYDexd9MLS6vk5HxLU= 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 Subject: [PATCH 19/20] usb/gadget/udc: renesas: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:53 +0200 Message-Id: <20200903112554.34263-20-paul@crapouillou.net> In-Reply-To: <20200903112554.34263-1-paul@crapouillou.net> References: <20200903112554.34263-1-paul@crapouillou.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_072837_136420_EBA961CA X-CRM114-Status: GOOD ( 13.88 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Cercueil , openbmc@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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/gadget/udc/renesas_usb3.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 0c418ce50ba0..4e8ba5914eff 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2867,8 +2867,7 @@ static int renesas_usb3_probe(struct platform_device *pdev) return ret; } -#ifdef CONFIG_PM_SLEEP -static int renesas_usb3_suspend(struct device *dev) +static int __maybe_unused renesas_usb3_suspend(struct device *dev) { struct renesas_usb3 *usb3 = dev_get_drvdata(dev); @@ -2884,7 +2883,7 @@ static int renesas_usb3_suspend(struct device *dev) return 0; } -static int renesas_usb3_resume(struct device *dev) +static int __maybe_unused renesas_usb3_resume(struct device *dev) { struct renesas_usb3 *usb3 = dev_get_drvdata(dev); @@ -2899,7 +2898,6 @@ static int renesas_usb3_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(renesas_usb3_pm_ops, renesas_usb3_suspend, renesas_usb3_resume); @@ -2909,7 +2907,7 @@ static struct platform_driver renesas_usb3_driver = { .remove = renesas_usb3_remove, .driver = { .name = udc_name, - .pm = &renesas_usb3_pm_ops, + .pm = pm_ptr(&renesas_usb3_pm_ops), .of_match_table = of_match_ptr(usb3_of_match), }, };