Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp615131pxk; Thu, 3 Sep 2020 08:17:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2H4g/uUTIHkmvEGQYCH4ocT+Vt+oJm0Pn+evIQuOxLmCN+2nIZrLFhxQri0guqnabTYuv X-Received: by 2002:a17:906:f28b:: with SMTP id gu11mr2558915ejb.407.1599146268308; Thu, 03 Sep 2020 08:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599146268; cv=none; d=google.com; s=arc-20160816; b=lz8mgxKBlhCWcf6SMMF2AI/zo+omNZjj2k3vbN8PgZ7NqVVj2ebjZ5W8MMyeLWSLAI GpZyKSWPc9KYIZcyNayUoxX9PyY8FEwlLXmGiM8R8opBN0+c9WAHfnggKhkFnUYX0yn9 Qh6QsoQCDO/QJkCjylMSwfjJ2SP6IQYqlmTkZJnbTzGX9wVcrApe4wlLQgK7on07+BXn 7iQ1Sa54tkItwEDpGKqSKPTwfX0MRUzyWQtbLfrM/2L2GWIzw60v/RJ7OmECBNTomd1X b/dX9svCYjHkd/e9NrpE1ql3sBZMhMq8CyHQ+J2+SR+WE5dQBPIm+8+58G6r1Ss+rvB6 3v0g== 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=hcIYdvuHgCnX105VYCMzaNdLpnwL2oejz7eq3kv/QCg=; b=LQ5GAUbTpG3NtWX7OUWhOApRJHr3G5xlhSYCcGNDNByj59/EGvFL+tyLpGYxEN6vec s3qnXkH1CFGDNP4bwIqnwu8r4oM+fK8pTrEihw1p+YhgppYUQjv8mlf3afUBEodMWXns /YKQItLXx/ei+TryA8u4bcts8FFKOmUQ2RtHm38GAlbUXRth4/mn0WPfapQFVg1ZGKpg tOMWVg0jUDpkt1I15yjDNIdXodk5GDV2AsY1Gu4Asqd2Qwr2te0+ukvyz0HFpybIn5C0 l0k/qOp8do8PBS/qoy+HUVDuK8wK881es3yB+eKxuJ1gV+BsGg+gi3J+iK0M3Gvg0bQj lhpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=l7Tbgxzp; 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 2si1822687edw.176.2020.09.03.08.17.25; Thu, 03 Sep 2020 08:17:48 -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=l7Tbgxzp; 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 S1728713AbgICLrW (ORCPT + 99 others); Thu, 3 Sep 2020 07:47:22 -0400 Received: from crapouillou.net ([89.234.176.41]:51944 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728646AbgICLfK (ORCPT ); Thu, 3 Sep 2020 07:35:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132402; 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=hcIYdvuHgCnX105VYCMzaNdLpnwL2oejz7eq3kv/QCg=; b=l7TbgxzpKLSy0f6XLh5qi4mNX+GQCUAKmtU+E1nWIeS96sZKn1LB6jiycJjFMuiwsFy0TA 2zCaaa2m6gE/ximHchPnzqKmlRw6nu45OsdT97mINoU/Tc4nlNTa9NBZg0Qq7wHf0VUs87 vUj9NR0sMCrRUu/irsY+vlaud1PF1Ls= 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 15/20] usb/gadget/udc: atmel: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:49 +0200 Message-Id: <20200903112554.34263-16-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/atmel_usba_udc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index a6426dd1cfef..38da3f3ebde7 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2359,8 +2359,7 @@ static int usba_udc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int usba_udc_suspend(struct device *dev) +static int __maybe_unused usba_udc_suspend(struct device *dev) { struct usba_udc *udc = dev_get_drvdata(dev); @@ -2393,7 +2392,7 @@ static int usba_udc_suspend(struct device *dev) return 0; } -static int usba_udc_resume(struct device *dev) +static int __maybe_unused usba_udc_resume(struct device *dev) { struct usba_udc *udc = dev_get_drvdata(dev); @@ -2417,7 +2416,6 @@ static int usba_udc_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume); @@ -2425,7 +2423,7 @@ static struct platform_driver udc_driver = { .remove = usba_udc_remove, .driver = { .name = "atmel_usba_udc", - .pm = &usba_udc_pm_ops, + .pm = pm_ptr(&usba_udc_pm_ops), .of_match_table = atmel_udc_dt_ids, }, }; -- 2.28.0