Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp471921pxk; Thu, 3 Sep 2020 04:56:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOe6I6BdTmv2+pd8aCABskIjmIfVxA6FKNgo6tm7QbwBNF/h91725qYQlvY93OknEw9rJX X-Received: by 2002:a17:906:a242:: with SMTP id bi2mr1721493ejb.122.1599134175817; Thu, 03 Sep 2020 04:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599134175; cv=none; d=google.com; s=arc-20160816; b=cdK4hdyBNVCsfnOeDjTcUWZg0A5OnzJzbjim6LzSMvZkYw0ltHzDzrqhLQ+c7aIYcM lLLTByPLqXDwpI075sfMSO8CnEb9ZPg4fQcGoedshL4zcvI9FIPShFrSs/zc3lBys64m fmzaXtYSvzvhAR0E0C3CfoDNn3JL9XAMbX8OMXCyZoZkm5Wryx/fMElUCB0ll4PxMTEG XQHwimPiI4PI4wuZRhFmrkyG+12pjm9dEAjJjS3lC8/aczq/7xat6gmHgCLP4ThdWRE5 tueBT6+esh5fMSihTe/bp+h3BBvt6ik2/R/acLhmYBXhsYTKTf7PZYh2/1pjDJxc9btY Oo0w== 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=J6Cjz5sekpGDn1rcuBCLu89HY0vBE+cfODvggh6BD5M=; b=pX3zytLzqN0mXWJbYdEtxP0W2rliAdw865sOFJIMzkG2P5WKBaqBW8WL8the3MQ3yN mUIwaIKlWxnUxmgGSFlZWhXY18KVHfVie4NOCY/FnmknHGF5qVDvFkaOdC06pasKUer9 3VYEQORzMawTikURUT03RdKINqTfE5aZCW1KDB1BMOSaiV5H2Q5hSdOFfiLPUBCMIL5L T8iP75t386zpSrLx1AF+hcDBLZkil/ZqjrLnJA2q/rnE9OIKdzHJkWeasqPpw5FH5L/J O3e2PDqLZYvCixaq9JHtw7l2dIGmKEz8z8u7mvCZ6vwQ7iaqcL5pXuX+PbPec2HJj7V0 0VWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=xsWwAFxu; 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 t22si1680207ejy.466.2020.09.03.04.55.50; Thu, 03 Sep 2020 04:56:15 -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=xsWwAFxu; 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 S1728716AbgICLu6 (ORCPT + 99 others); Thu, 3 Sep 2020 07:50:58 -0400 Received: from crapouillou.net ([89.234.176.41]:52056 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728665AbgICLhy (ORCPT ); Thu, 3 Sep 2020 07:37:54 -0400 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 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 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 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/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), }, }; -- 2.28.0