Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp469418pxk; Thu, 3 Sep 2020 04:51:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhhv6k33rdTYcnjKNWyfyWFTpRlDhTCJczbUXeG1zNVEJ6vASCYF0BTR8WO/SygAnZnSLJ X-Received: by 2002:a17:906:1794:: with SMTP id t20mr1607504eje.229.1599133887024; Thu, 03 Sep 2020 04:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599133887; cv=none; d=google.com; s=arc-20160816; b=AdZnuikWf4jXUDYF7JaPFSh3tPK+gkF4uXHDDcOgA4lOBdkBlLu0IviipI1PzZnf8z 37JuHdhE26Ba5OoQiLxGX1DB8iMRqb3E9fmiPRxbbNRGCSuzkJjBr3P54CKbOwP/A1Wp NubpMXxAFlHeDB88AQNW3+/nABPiTUKySx7UuYWjiaaJdlSCBtqd5hh784RXqzcrVU2j 0hzVEGjUDbLH3TlGA/DQa9s+H/fH9yC1wAKZcOZqf/L2cBx8ish9AAyk8wWkPXdQZOp5 K2uu30UPIYN7dFMV8rU68jdmTNSGR7zXxSo5WvuYTNB3oVUyQlaeLCyo1cKSmhgLkmnl 5fmw== 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=TaaXhuQwpGfBU2Mff+uP9EGClNX7jlEbfP7HfZOJNPw=; b=a4piEyJeUqrK6YJWkLrfBuxecRwrXbCRzlUj7tF3wdRBHj/DCwdG0fgRJcDv3/384b AFwYOlOUDkb4y6V1zG0Dp1nQhMNtQuDesvjKEoiwqNCKi0ITdUiLnO8iV+zh+Fpby4Z6 qRvajyFXSp0YjqdOw0BodAslTHOwkR/Ss06ev7T62aB234v3R1yj8A9oXTghWHhYHsRN 561MysXzYthb57J85sDPlGg2NHsm73MpNN1j5ydjsbPP0+PnT90rbDiatEtRgK8FKKBe 4RjWnOxmuCOCv9Gjgi7B2Xqrl2ZYr5TmssUCoAHfc4NR8a56a31qqGAEJfTpOTOf7vTO t/jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=bNYvg+rq; 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 x22si1629068ejv.378.2020.09.03.04.51.02; Thu, 03 Sep 2020 04:51:27 -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=bNYvg+rq; 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 S1726292AbgICLpI (ORCPT + 99 others); Thu, 3 Sep 2020 07:45:08 -0400 Received: from crapouillou.net ([89.234.176.41]:51956 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728687AbgICLfd (ORCPT ); Thu, 3 Sep 2020 07:35:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132405; 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=TaaXhuQwpGfBU2Mff+uP9EGClNX7jlEbfP7HfZOJNPw=; b=bNYvg+rqcT9I6lnK9NOk6dQ3I3ikbPyWzzWj+7j7zASSo8UWh2eNXEhZT6A0FlMbpwnKuO AqKMlucd0Apm1bT4Mtxx1jBksZGS1c2rOj5Az/A5Z0OoSkipsXVWktFPoEIL7xqgBcr9Cy snbEctfTNJq76cOvdt179trzl0YEbQc= 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 16/20] usb/gadget/udc: bdc: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:50 +0200 Message-Id: <20200903112554.34263-17-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/bdc/bdc_core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index 5ff36525044e..da3a7a59ccae 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -597,8 +597,7 @@ static int bdc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int bdc_suspend(struct device *dev) +static int __maybe_unused bdc_suspend(struct device *dev) { struct bdc *bdc = dev_get_drvdata(dev); int ret; @@ -611,7 +610,7 @@ static int bdc_suspend(struct device *dev) return ret; } -static int bdc_resume(struct device *dev) +static int __maybe_unused bdc_resume(struct device *dev) { struct bdc *bdc = dev_get_drvdata(dev); int ret; @@ -630,8 +629,6 @@ static int bdc_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ - static SIMPLE_DEV_PM_OPS(bdc_pm_ops, bdc_suspend, bdc_resume); @@ -644,7 +641,7 @@ static const struct of_device_id bdc_of_match[] = { static struct platform_driver bdc_driver = { .driver = { .name = BRCM_BDC_NAME, - .pm = &bdc_pm_ops, + .pm = pm_ptr(&bdc_pm_ops), .of_match_table = bdc_of_match, }, .probe = bdc_probe, -- 2.28.0