From patchwork Thu Sep 3 11:25:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753331 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 0A392722 for ; Thu, 3 Sep 2020 11:26: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 D4E652078E for ; Thu, 3 Sep 2020 11:26:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XJJlejc5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="JuRU33RE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4E652078E 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=irBSVsymK8irobGgRoppFsR3j4dg8jqUqUdNhE0jIWE=; b=XJJlejc5EL3cvXgI7GLqeG1OJ EhF9K0iTueceh+hl8np50JcBYZHKUKMUELZ5ohvlfm+zSmZ76CCBTjj8tWC1Ebn3vMa+Y2a6Y5J88 Su0IOU8wpfSpciDfMmAU0E6zzDIkSU0WFfLRa15yr17D3CLHlaUkpR37tkpGamToNImp9oipIrx/Z zYnrPH3d47WWli/L+xjuubJiQl0U6fo5RGskY22yDtr+6o8X9+GaT7QLfElpAPClmqxmiBaNp7vKy NUuEFfiYnk34WEbuPZsxTmpcqTidWe3CSaLuMQXsGNT/uQMuhcR8ogwnwxFOf5qdAcU25eksSA+Dc 9rswCpUNg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNh-0002MD-RD; Thu, 03 Sep 2020 11:26:17 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNe-0002LF-Iy for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:26:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132365; 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=nylEOZ/ud9dJuiCng3IS9pJVAuTv7JQFJCJlDdh38kA=; b=JuRU33REs724J6eVnbhIDjfeUMWW9tOA78MdFBc3i95nB9cktLPxKK2ChHPcQK628+jfXp i3+e9cDmuhgUwtVBolHIKO9sH8/eX+Ybb3YnUm1v+0udsj1vdEp3baEUPowH0LfsUOS6V5 R9po9WQ1ueOAKCWhmtjbsOVyV8m+OMk= 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 01/20] usb/host: ohci-platform: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:35 +0200 Message-Id: <20200903112554.34263-2-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_072614_768376_DCD02AF4 X-CRM114-Status: GOOD ( 15.31 ) 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/host/ohci-platform.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 4a8456f12a73..21400d7d8b0a 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -176,22 +176,21 @@ static int ohci_platform_probe(struct platform_device *dev) if (pdata->num_ports) ohci->num_ports = pdata->num_ports; -#ifndef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO - if (ohci->flags & OHCI_QUIRK_BE_MMIO) { + if (!IS_ENABLED(CONFIG_USB_OHCI_BIG_ENDIAN_MMIO) && + ohci->flags & OHCI_QUIRK_BE_MMIO) { dev_err(&dev->dev, "Error: CONFIG_USB_OHCI_BIG_ENDIAN_MMIO not set\n"); err = -EINVAL; goto err_reset; } -#endif -#ifndef CONFIG_USB_OHCI_BIG_ENDIAN_DESC - if (ohci->flags & OHCI_QUIRK_BE_DESC) { + + if (!IS_ENABLED(CONFIG_USB_OHCI_BIG_ENDIAN_DESC) && + ohci->flags & OHCI_QUIRK_BE_DESC) { dev_err(&dev->dev, "Error: CONFIG_USB_OHCI_BIG_ENDIAN_DESC not set\n"); err = -EINVAL; goto err_reset; } -#endif pm_runtime_set_active(&dev->dev); pm_runtime_enable(&dev->dev); @@ -267,8 +266,7 @@ static int ohci_platform_remove(struct platform_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int ohci_platform_suspend(struct device *dev) +static int __maybe_unused ohci_platform_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev->platform_data; @@ -286,7 +284,7 @@ static int ohci_platform_suspend(struct device *dev) return ret; } -static int ohci_platform_resume(struct device *dev) +static int __maybe_unused ohci_platform_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev_get_platdata(dev); @@ -306,7 +304,6 @@ static int ohci_platform_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct of_device_id ohci_platform_ids[] = { { .compatible = "generic-ohci", }, @@ -332,7 +329,7 @@ static struct platform_driver ohci_platform_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ohci-platform", - .pm = &ohci_platform_pm_ops, + .pm = pm_ptr(&ohci_platform_pm_ops), .of_match_table = ohci_platform_ids, } }; From patchwork Thu Sep 3 11:25:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753333 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 C94A214E3 for ; Thu, 3 Sep 2020 11:26:34 +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 A0314208B3 for ; Thu, 3 Sep 2020 11:26:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NrUO6yn0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="cZdEy8G+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0314208B3 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=Erfuw2U4fp195ax1oCtVuWAmtAadeszwWdWIMrV9ffM=; b=NrUO6yn0E6qXQ2Kkku03i280p 2Oh1JDrSPmiuj3+treU5ZmamflBbRkyF/PunJXvR4Rdd4KbKHUFUKvX6tYOB+0WVz//AI6rGcWlKh KvhF5nL7hg6eBc7w/XLH5ZmyXgkSR4m7YAVpuXvHT4r/8Q+xDW5otRV7rfKtA4W/n9eJI6qOlafTb bNdROABl2iHCFXThdzghjqqm7pQXeGIqAt8hSoXn13kye/prDThMMi9LwgDxDxvrc2kETU/dOCzd5 +kiPbA+V3aUCO0WAGfAsBpJaPo3oO9YAEy+IgwtyBVmlDhyFYWAqozGIwO1yo2BeOjcmdeynvpZpF kGkPbnIUw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNo-0002OT-8n; Thu, 03 Sep 2020 11:26:24 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNl-0002NA-CE for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:26:22 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_072621_572079_9112E568 X-CRM114-Status: GOOD ( 14.87 ) 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/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, } }; From patchwork Thu Sep 3 11:25:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753335 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 E8ECA722 for ; Thu, 3 Sep 2020 11:26:42 +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 C0C432083B for ; Thu, 3 Sep 2020 11:26:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AZLU4TVI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="FxZYS6z3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0C432083B 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=3kSljRd4vQXKS9Y4vMEWGwdfRM40pHeQyydcMwLUG+I=; b=AZLU4TVITIjr3VvNC3bkK0jwJ Fu9QJEC/oFcZ+q28ZF77TUlwihpGysBC4L1nLY+hyhyLpa6Wp9mFnBvH++LDsPucK0KlWr2ZcWmYm 6rfzhnUlomyKKV9xhRm4L1FP/YiYhgNck/br+N4V+Z8AAc/j1q/G1a0Jx9252uz1DKmnuH6j2MN86 /diFDoT3eS5aZ0T1uQeauFnuk5W2bGjmD4a5Wkp1a6hIE7iI+Q903xTl3jzZnbuSurMAMAm8XjBQG rCBHC5q268hHhgHUuvW8wosy3kAtribe3guXS9EHQ94Y4I+kvdm1TRaKSTBae2oFJxRtqiLxepyc4 iz41BnGHg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNv-0002Qi-2V; Thu, 03 Sep 2020 11:26:31 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNs-0002Pg-Dp for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:26:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132370; 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=ruSiYGMYEYwNR6DS0j0tVkBt7LK6N4xlExna60GJosA=; b=FxZYS6z3pPyZLRrUjh2dW2tB5f2tjvTCsiK/chiWBa/qXenSG+eYjMmtI66CraPCt3V2Ar fu+8Mhe20Q9WGLKBy/kMAeqWTuvZ1iEf8F9CITOWigjXBmDiXsNDu9Vn6QAjG47KG6l3T6 VqobcZ0NBnJeO4Bg5XZ946SGd9K0G7Y= 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 03/20] usb/host: ehci-npcm7xx: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:37 +0200 Message-Id: <20200903112554.34263-4-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_072628_609709_89B41875 X-CRM114-Status: GOOD ( 14.46 ) 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/host/ehci-npcm7xx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ehci-npcm7xx.c b/drivers/usb/host/ehci-npcm7xx.c index adaf8fb4b459..6b5a7a873e01 100644 --- a/drivers/usb/host/ehci-npcm7xx.c +++ b/drivers/usb/host/ehci-npcm7xx.c @@ -37,8 +37,7 @@ static const char hcd_name[] = "npcm7xx-ehci"; static struct hc_driver __read_mostly ehci_npcm7xx_hc_driver; -#ifdef CONFIG_PM_SLEEP -static int ehci_npcm7xx_drv_suspend(struct device *dev) +static int __maybe_unused ehci_npcm7xx_drv_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); bool do_wakeup = device_may_wakeup(dev); @@ -46,14 +45,13 @@ static int ehci_npcm7xx_drv_suspend(struct device *dev) return ehci_suspend(hcd, do_wakeup); } -static int ehci_npcm7xx_drv_resume(struct device *dev) +static int __maybe_unused ehci_npcm7xx_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_npcm7xx_pm_ops, ehci_npcm7xx_drv_suspend, ehci_npcm7xx_drv_resume); @@ -183,7 +181,7 @@ static struct platform_driver npcm7xx_ehci_hcd_driver = { .driver = { .name = "npcm7xx-ehci", .bus = &platform_bus_type, - .pm = &ehci_npcm7xx_pm_ops, + .pm = pm_ptr(&ehci_npcm7xx_pm_ops), .of_match_table = npcm7xx_ehci_id_table, } }; From patchwork Thu Sep 3 11:25:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753339 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 44AFC166C for ; Thu, 3 Sep 2020 11:26:50 +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 1C8782083B for ; Thu, 3 Sep 2020 11:26:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SE0Snjjp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="n/sywxZY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C8782083B 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=60MuK/3PSp/LFMoijP0GWuGhaIAVCFHsCBMiM2oKPcE=; b=SE0SnjjpNFxUFaBvIyZ/FvVLv CMLDga48g++raargT3zMP6v2mKxDQibepiyN10rJSMIrcHbVmSw4pNzqDIn9fwG4RdfNRNvQBvpeI OYOyXt1BwjkrVbtUa10Z8QiiIWwbfa2OcE9MA2jCE14oJ6X5Kn8jEzSpDf+YB2F8/uwekxea/gO6d 9lsd8mMn7TpQJSNoUaRRfUb14ixnKT5Ou6dQggpVpCejL+Ag2+qpczWNbJYTMh/L+X31afHHXldPK d68EVR5Amwan7Ofw4mgaA5pFvd5dgNBY9SBk41Cf9rRvciYwzexpCM7ZuWvIaQiO6tz1Iae5YEs6n ezzgWIs1A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnO3-0002Tu-G3; Thu, 03 Sep 2020 11:26:39 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnNz-0002SK-KX for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:26:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132373; 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=7SglRxexWR02Jo1xu/7HEB4Hand1VF9eBKwwkPhycx4=; b=n/sywxZY3LJtrLFp8PyB9RN3P2+He4kBjU2FJO06S1MBNfZGpYeWilBBTEMOjlEaFWtiZ7 7+Ib+m2BtC4kB4qLGttVnuTJ2wEP39qmEVeu84HaiZS2RzTpmQqeZVA4iC5i+7XqqEHHpF Nx7ZrNzJXJg0TMCBkuHfpsdNb/Cp408= 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 04/20] usb/host: ehci-platform: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:38 +0200 Message-Id: <20200903112554.34263-5-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_072635_822290_567142BA X-CRM114-Status: GOOD ( 14.83 ) 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/host/ehci-platform.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 006c4f6188a5..4585a3a24678 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -410,8 +410,7 @@ static int ehci_platform_remove(struct platform_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int ehci_platform_suspend(struct device *dev) +static int __maybe_unused ehci_platform_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ehci_pdata *pdata = dev_get_platdata(dev); @@ -433,7 +432,7 @@ static int ehci_platform_suspend(struct device *dev) return ret; } -static int ehci_platform_resume(struct device *dev) +static int __maybe_unused ehci_platform_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ehci_pdata *pdata = dev_get_platdata(dev); @@ -464,7 +463,6 @@ static int ehci_platform_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct of_device_id vt8500_ehci_ids[] = { { .compatible = "via,vt8500-ehci", }, @@ -499,7 +497,7 @@ static struct platform_driver ehci_platform_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ehci-platform", - .pm = &ehci_platform_pm_ops, + .pm = pm_ptr(&ehci_platform_pm_ops), .of_match_table = vt8500_ehci_ids, .acpi_match_table = ACPI_PTR(ehci_acpi_match), } From patchwork Thu Sep 3 11:25:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753349 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 29B70166C for ; Thu, 3 Sep 2020 11:26:57 +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 EBF9B2087C for ; Thu, 3 Sep 2020 11:26:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="N8ZEG7G6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="b+pvUnRt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBF9B2087C 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=khuJ4eXaQWbAuk8S9NZOZipxSoD7PwN65279BSA7ugo=; b=N8ZEG7G6WsdRz8vLNe/XOoRcR l0XlBpw3adZsKq6BlsmxbvNmYDGzkxp3WNP0brYPeTbBic6SU1GLlP3sfEVO59zbrIlKtl49OgOgP YbP5UjJWupWqLSzK90lLUcJDFd09kBySok+IzQWNbTYkXkpSe7G6CyL7X8QopZVd60pEkLfwzGhT0 pTsozXiBkOzEsxUwrm817gyFoUCsjRW3SXW5miVbZiHnbB5goXYC7nNmCXld0SOcSlBagbBdkRRjp sk2YB/hhyRIZVkHO+1ZKDMtC7zjwFzDb4dTxOy03t3DNARTopCZFoPf1D5t+SEXhBwOq3XCuWmHss QpsvtnCkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnO9-0002Wo-RC; Thu, 03 Sep 2020 11:26:45 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnO6-0002VJ-Rz for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:26:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132376; 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=LJlqqFXg/MOSyVPsBSEVTxCBPa0T4MkeyfIM49qM1g0=; b=b+pvUnRtEmJmpiSgtZPGUBj4jbeHQi4WsVy7CavoSjIUC28Cc4MpspoqZpIKRfwIrkBLBs RZkLN2dTM0yjA5rbk4otHIJt/lwY0is9oymHiRp5Mtl0pDgiVY5erZzlOwmsrH4ojxsLZ8 ct0D39tVUdLlv8sq6t7DbOx5TANfc3Q= 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 05/20] usb/cdns3: core: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:39 +0200 Message-Id: <20200903112554.34263-6-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_072643_086474_E877B20C X-CRM114-Status: GOOD ( 14.01 ) 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/cdns3/core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 5c1586ec7824..dacab9e9ef92 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -546,9 +546,7 @@ static int cdns3_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP - -static int cdns3_suspend(struct device *dev) +static int __maybe_unused cdns3_suspend(struct device *dev) { struct cdns3 *cdns = dev_get_drvdata(dev); unsigned long flags; @@ -568,7 +566,7 @@ static int cdns3_suspend(struct device *dev) return 0; } -static int cdns3_resume(struct device *dev) +static int __maybe_unused cdns3_resume(struct device *dev) { struct cdns3 *cdns = dev_get_drvdata(dev); unsigned long flags; @@ -588,11 +586,8 @@ static int cdns3_resume(struct device *dev) return 0; } -#endif -static const struct dev_pm_ops cdns3_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(cdns3_suspend, cdns3_resume) -}; +static SIMPLE_DEV_PM_OPS(cdns3_pm_ops, cdns3_suspend, cdns3_resume); #ifdef CONFIG_OF static const struct of_device_id of_cdns3_match[] = { @@ -608,7 +603,7 @@ static struct platform_driver cdns3_driver = { .driver = { .name = "cdns-usb3", .of_match_table = of_match_ptr(of_cdns3_match), - .pm = &cdns3_pm_ops, + .pm = pm_ptr(&cdns3_pm_ops), }, }; From patchwork Thu Sep 3 11:25:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753373 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 6464914E3 for ; Thu, 3 Sep 2020 11:29:20 +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 399A62083B for ; Thu, 3 Sep 2020 11:29:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e/Jj4L/8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="FOTskssg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 399A62083B 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=ZFkIYL9bJ0V14AijoYyYTk/SJr8D2I0BZgvwOmgEt84=; b=e/Jj4L/8pUx1j6QCSSUPZg/wK 8AJpcBmEG/1nJZnoc0mNFfaAJaPHqwpCqgJFZTrVYwrqOPNFwMtiA3Dp9eQCEQ+Td+4XLgW7XvFI2 4mV/ep4NQFUoyeEnVMEnOhzOIsXl55gm2hvSU4Z3UxdRjgFcV9ImKL0J9i+7Z/Lp1UdG+fAy+T7y8 9rAOPuvZARiI9S7mip0QBSUfj1AuXrZJdB94w4EwFReRHSozYAsrEb3EJA6zoUwe5IhFQBWqr1aW3 7rxR+Xmaf9i9bgiapP4ccof1/YTdYaDirla6V7FMW82bPLKj1ql63XDFGLHoKu3lcoFvzPxVuhjSz wd++F9X5Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOb-0002l1-9g; Thu, 03 Sep 2020 11:27:13 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOE-0002ZB-A2 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:26:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132378; 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=VitADMM0fnVC5UEnlJQqBbjbeuxkosY7PKciS9JCWhQ=; b=FOTskssgTXu613ZyXQFH73GPSn4sAH4YrP0JV6oEP+WsASxewPFIop8x6uA55dH2X0sPIU nYurhrftzHdBnJRaCPCA6k8tDEyO3YMnmeLEyHvxrjcjUS+VBt6Ymr6jWUZnVt/N1mci+7 cxpnf7I+HG5vzL5cT8vb59uEQPISUYA= 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 06/20] usb/chipidea: core: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:40 +0200 Message-Id: <20200903112554.34263-7-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_072650_661203_0715F646 X-CRM114-Status: GOOD ( 15.43 ) 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/chipidea/core.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index aa40e510b806..af64ab98fb56 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -1231,9 +1231,8 @@ static int ci_hdrc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM /* Prepare wakeup by SRP before suspend */ -static void ci_otg_fsm_suspend_for_srp(struct ci_hdrc *ci) +static void __maybe_unused ci_otg_fsm_suspend_for_srp(struct ci_hdrc *ci) { if ((ci->fsm.otg->state == OTG_STATE_A_IDLE) && !hw_read_otgsc(ci, OTGSC_ID)) { @@ -1245,7 +1244,7 @@ static void ci_otg_fsm_suspend_for_srp(struct ci_hdrc *ci) } /* Handle SRP when wakeup by data pulse */ -static void ci_otg_fsm_wakeup_by_srp(struct ci_hdrc *ci) +static void __maybe_unused ci_otg_fsm_wakeup_by_srp(struct ci_hdrc *ci) { if ((ci->fsm.otg->state == OTG_STATE_A_IDLE) && (ci->fsm.a_bus_drop == 1) && (ci->fsm.a_bus_req == 0)) { @@ -1259,7 +1258,7 @@ static void ci_otg_fsm_wakeup_by_srp(struct ci_hdrc *ci) } } -static void ci_controller_suspend(struct ci_hdrc *ci) +static void __maybe_unused ci_controller_suspend(struct ci_hdrc *ci) { disable_irq(ci->irq); ci_hdrc_enter_lpm(ci, true); @@ -1277,7 +1276,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci) * interrupt (wakeup int) only let the controller be out of * low power mode, but not handle any interrupts. */ -static void ci_extcon_wakeup_int(struct ci_hdrc *ci) +static void __maybe_unused ci_extcon_wakeup_int(struct ci_hdrc *ci) { struct ci_hdrc_cable *cable_id, *cable_vbus; u32 otgsc = hw_read_otgsc(ci, ~0); @@ -1294,7 +1293,7 @@ static void ci_extcon_wakeup_int(struct ci_hdrc *ci) ci_irq(ci->irq, ci); } -static int ci_controller_resume(struct device *dev) +static int __maybe_unused ci_controller_resume(struct device *dev) { struct ci_hdrc *ci = dev_get_drvdata(dev); int ret; @@ -1332,8 +1331,7 @@ static int ci_controller_resume(struct device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int ci_suspend(struct device *dev) +static int __maybe_unused ci_suspend(struct device *dev) { struct ci_hdrc *ci = dev_get_drvdata(dev); @@ -1366,7 +1364,7 @@ static int ci_suspend(struct device *dev) return 0; } -static int ci_resume(struct device *dev) +static int __maybe_unused ci_resume(struct device *dev) { struct ci_hdrc *ci = dev_get_drvdata(dev); int ret; @@ -1386,9 +1384,8 @@ static int ci_resume(struct device *dev) return ret; } -#endif /* CONFIG_PM_SLEEP */ -static int ci_runtime_suspend(struct device *dev) +static int __maybe_unused ci_runtime_suspend(struct device *dev) { struct ci_hdrc *ci = dev_get_drvdata(dev); @@ -1408,13 +1405,12 @@ static int ci_runtime_suspend(struct device *dev) return 0; } -static int ci_runtime_resume(struct device *dev) +static int __maybe_unused ci_runtime_resume(struct device *dev) { return ci_controller_resume(dev); } -#endif /* CONFIG_PM */ -static const struct dev_pm_ops ci_pm_ops = { +static const struct dev_pm_ops __maybe_unused ci_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(ci_suspend, ci_resume) SET_RUNTIME_PM_OPS(ci_runtime_suspend, ci_runtime_resume, NULL) }; @@ -1424,7 +1420,7 @@ static struct platform_driver ci_hdrc_driver = { .remove = ci_hdrc_remove, .driver = { .name = "ci_hdrc", - .pm = &ci_pm_ops, + .pm = pm_ptr(&ci_pm_ops), .dev_groups = ci_groups, }, }; From patchwork Thu Sep 3 11:25:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753359 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 33C04722 for ; Thu, 3 Sep 2020 11:27:57 +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 F34752078E for ; Thu, 3 Sep 2020 11:27:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SLZ8BImx"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="jYQYUggT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F34752078E 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=SziVZKR9JPtzfYrrZwh6eij6Z+pDpYFyVjavtWXvEDA=; b=SLZ8BImxPy9rTeMu0QrVSMZm2 VDhbM8WjbdCMUR/pflAE7Ton9I4XnBRTXM63nfcVXm9zxINeyS841eu2/gspNvLK/oqNawn6gIhHz rQYnCjCRwLOXMqh2bnvK8nOQHvngSTdu8a+uJSgXGFZOujIO3rN8C78+DSqWGPln2Jvu3TAWpLoWQ tDH7XjKrdK/G2EBhARWm9KnQj09FvYPOqFsrOTC4LKyH7DTm5Fg4MJWvKtcInspRG061tq08Li+p2 C6KZ2o6J/vNF5hgPhoGlNI0v/OoMXEoSkVa4QrekaXWwllkXm0BEWgSDV7XnYZUTo5ow4XJiyN5Zh TheHAxTsQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnP2-00033d-W5; Thu, 03 Sep 2020 11:27:41 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnON-0002eg-Ps for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132381; 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=Q++myQyFVGc5viHm1my4fERz4BkgXBYuJlPFvw347zc=; b=jYQYUggTNuQ1S6/3AD+ZmojFJNLvAFPZAu3nlpl+R3Zxjg7o0i+1ZV9A/w9OncyVirf37r RDUjJo7sVHvcVRBsCymTMBSH3cp4BYuaJq2KJjp3ncoaZ+8635HCMWW3Twt/Oy+vizidMX QmnPSvEHoqj0+1aIe8xKa3yGbcwpIp0= 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 07/20] usb/misc: usb3503: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:41 +0200 Message-Id: <20200903112554.34263-8-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_072700_055603_37F0E01E X-CRM114-Status: GOOD ( 13.49 ) 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/misc/usb3503.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index 116bd789e568..48099c6bf04c 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -322,8 +322,7 @@ static int usb3503_platform_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int usb3503_suspend(struct usb3503 *hub) +static int __maybe_unused usb3503_suspend(struct usb3503 *hub) { usb3503_switch_mode(hub, USB3503_MODE_STANDBY); clk_disable_unprepare(hub->clk); @@ -331,7 +330,7 @@ static int usb3503_suspend(struct usb3503 *hub) return 0; } -static int usb3503_resume(struct usb3503 *hub) +static int __maybe_unused usb3503_resume(struct usb3503 *hub) { clk_prepare_enable(hub->clk); usb3503_switch_mode(hub, hub->mode); @@ -339,30 +338,29 @@ static int usb3503_resume(struct usb3503 *hub) return 0; } -static int usb3503_i2c_suspend(struct device *dev) +static int __maybe_unused usb3503_i2c_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); return usb3503_suspend(i2c_get_clientdata(client)); } -static int usb3503_i2c_resume(struct device *dev) +static int __maybe_unused usb3503_i2c_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); return usb3503_resume(i2c_get_clientdata(client)); } -static int usb3503_platform_suspend(struct device *dev) +static int __maybe_unused usb3503_platform_suspend(struct device *dev) { return usb3503_suspend(dev_get_drvdata(dev)); } -static int usb3503_platform_resume(struct device *dev) +static int __maybe_unused usb3503_platform_resume(struct device *dev) { return usb3503_resume(dev_get_drvdata(dev)); } -#endif static SIMPLE_DEV_PM_OPS(usb3503_i2c_pm_ops, usb3503_i2c_suspend, usb3503_i2c_resume); @@ -388,7 +386,7 @@ MODULE_DEVICE_TABLE(of, usb3503_of_match); static struct i2c_driver usb3503_i2c_driver = { .driver = { .name = USB3503_I2C_NAME, - .pm = &usb3503_i2c_pm_ops, + .pm = pm_ptr(&usb3503_i2c_pm_ops), .of_match_table = of_match_ptr(usb3503_of_match), }, .probe = usb3503_i2c_probe, @@ -400,7 +398,7 @@ static struct platform_driver usb3503_platform_driver = { .driver = { .name = USB3503_I2C_NAME, .of_match_table = of_match_ptr(usb3503_of_match), - .pm = &usb3503_platform_pm_ops, + .pm = pm_ptr(&usb3503_platform_pm_ops), }, .probe = usb3503_platform_probe, .remove = usb3503_platform_remove, From patchwork Thu Sep 3 11:25:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753361 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 818F3722 for ; Thu, 3 Sep 2020 11:28:05 +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 574D12083B for ; Thu, 3 Sep 2020 11:28:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tIz3nw9d"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="tnYD6IS4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 574D12083B 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=EyJcJRRVO0iQgY4fy87XYX67YBi5rJ/SUD2PzrdJNlo=; b=tIz3nw9dL/jL5frpHqrtxOxkx bW3H7mn62Fn+X77xwvi6D2lcueMYH5HTVGvcbChTyHwRT3Da5nCJF8izG33kAXhmHI70ABVala80V 0+jqYlPmmQ8CqU0xFnhAdbrHQKrX5dglVp1r9P+rdP8Br1oXm59ihelRs+X8MA7uyWs9KzxNyTDDn OMfNCVYeR7dDyfd6wwzh5GhERfYCSG9t4O/3uPx1umV5JpBNmCtMgtJiFBLK4wtRBqc6gOwmgHXch Mr2zq4dmTAbgNb+w38ta2BnUZZJEvcH5XxfXX5VgxV7BISRBCMHfr4bpVHn3Oms2FJt5olLAn86LD O5JSq7ydQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPC-00038O-73; Thu, 03 Sep 2020 11:27:50 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOV-0002jS-Vk for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132384; 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=2TQYLxc3aHxXcFDX5qciZlfYToGuHk7NHkGdcnudwus=; b=tnYD6IS4snnHJrlJyjB0BhU2Y/BNORywG/8Sfqgkjf31/Cy4M08Lt84RUw4tdSFSBZEYNu wfXt8hsktCQiQYAsXl8BVqtqjHbOxuVdH6NI4gHmY0iUyY4RsQ8r0fjQOY9a19Cqpxz/T3 yUCZWhbC7JHjcKvR2k1SabcdznHa1ig= 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 08/20] usb/misc: usb4604: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:42 +0200 Message-Id: <20200903112554.34263-9-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_072709_046305_D835A1E9 X-CRM114-Status: GOOD ( 13.69 ) 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/misc/usb4604.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/misc/usb4604.c b/drivers/usb/misc/usb4604.c index 1b4de651e697..2142af9bbdec 100644 --- a/drivers/usb/misc/usb4604.c +++ b/drivers/usb/misc/usb4604.c @@ -112,8 +112,7 @@ static int usb4604_i2c_probe(struct i2c_client *i2c, return usb4604_probe(hub); } -#ifdef CONFIG_PM_SLEEP -static int usb4604_i2c_suspend(struct device *dev) +static int __maybe_unused usb4604_i2c_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct usb4604 *hub = i2c_get_clientdata(client); @@ -123,7 +122,7 @@ static int usb4604_i2c_suspend(struct device *dev) return 0; } -static int usb4604_i2c_resume(struct device *dev) +static int __maybe_unused usb4604_i2c_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct usb4604 *hub = i2c_get_clientdata(client); @@ -132,7 +131,6 @@ static int usb4604_i2c_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(usb4604_i2c_pm_ops, usb4604_i2c_suspend, usb4604_i2c_resume); @@ -154,7 +152,7 @@ MODULE_DEVICE_TABLE(of, usb4604_of_match); static struct i2c_driver usb4604_i2c_driver = { .driver = { .name = "usb4604", - .pm = &usb4604_i2c_pm_ops, + .pm = pm_ptr(&usb4604_i2c_pm_ops), .of_match_table = of_match_ptr(usb4604_of_match), }, .probe = usb4604_i2c_probe, From patchwork Thu Sep 3 11:25:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753365 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 E12CD14E3 for ; Thu, 3 Sep 2020 11:28:41 +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 7376D2078E for ; Thu, 3 Sep 2020 11:28:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TsSH0U03"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="NT6bXm22" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7376D2078E 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=rSWwFx9hBkeEBOjAhBH29qzkjixPHqCcMUon0rbSkq4=; b=TsSH0U03q2CFGUKYBMXFr7Zf3 xlVvvhkJBXpwpaEaxJMTl3M3UnlzGcv91BOTAMd/Wl06CNZgc+z2AMTPzNfueEJX9U0dnqha0AzNU ehBViqVkIwJoDNvv7RAbLv4BL2A17AtHTgREcCqYbd8Pfq95ncJyO7ZCIr9Jk4m6gDJJtnTakKG4G bb2Gfwmx444FnUr4wtcEn6BU6mPkyI/7dF6zjn1qiM5IHwP+EHru6UX1+8UB3HuY5c3Kel4ZroNAO eqSRol7HEVNXbRpvI5vFvdYrBW6w8RdB3vUX2EO4iKUxFbrN/br3S8O+2s4gdd718LSwls61GtGJU 9TukiOY2g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPZ-0003NI-O7; Thu, 03 Sep 2020 11:28:13 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOd-0002nq-JS for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132386; 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=/HT6v/AkQG8sNb82MyIxu+857/MGP3ynerDd+/QF+M4=; b=NT6bXm22K1zaV5clRMxCKg0SUnoSS/HP14SzgmhrY2C0oCtaBdBnHyiki5RSoxo9YMg0wc VlGjjQNZqrqrIJsvppR7x/8r1X5Y/XgECewG8x/W00M9fiWcXDUwxobiKfMfJ366wNUM4I PtqmGeqLYhAmU8Cr/zkWSrTKKfrsUI4= 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 09/20] usb/musb: am35x: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:43 +0200 Message-Id: <20200903112554.34263-10-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_072715_818551_C1D2B972 X-CRM114-Status: GOOD ( 14.09 ) 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/musb/am35x.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 660641ab1545..6162111f4cae 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -547,8 +547,7 @@ static int am35x_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int am35x_suspend(struct device *dev) +static int __maybe_unused am35x_suspend(struct device *dev) { struct am35x_glue *glue = dev_get_drvdata(dev); struct musb_hdrc_platform_data *plat = dev_get_platdata(dev); @@ -564,7 +563,7 @@ static int am35x_suspend(struct device *dev) return 0; } -static int am35x_resume(struct device *dev) +static int __maybe_unused am35x_resume(struct device *dev) { struct am35x_glue *glue = dev_get_drvdata(dev); struct musb_hdrc_platform_data *plat = dev_get_platdata(dev); @@ -589,7 +588,6 @@ static int am35x_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume); @@ -598,7 +596,7 @@ static struct platform_driver am35x_driver = { .remove = am35x_remove, .driver = { .name = "musb-am35x", - .pm = &am35x_pm_ops, + .pm = pm_ptr(&am35x_pm_ops), }, }; From patchwork Thu Sep 3 11:25:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753371 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 3B250722 for ; Thu, 3 Sep 2020 11:29:16 +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 0C6F52078E for ; Thu, 3 Sep 2020 11:29:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jPACY03t"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="u8iCRRQv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C6F52078E 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=e1xheNo8b1I95i+GN0nyiizXncZke1yEc/v8W1OEImE=; b=jPACY03tlNqnqesSa2HsaUlhR MJQPMmZOc87CFonPouyAiRjVx0XPJz1N0Vg3akm7diQFTB8ArsY5RRMmBvKD7Enl3t3JlNvqf8B5K KxeYPQvKGottmNrtVW6QaBFlET9W8JnDub0mDFV8NEKufXXRNybnbF4KQLtI6kEW8HlvjB6vmsRH4 KIL/UG2iSBqVRlf7viO9IzqfJ+TCtxRs2BzIrcqgMC8B+ySMlYnwSMvr3IIKr7beG6F3ppcPJPezc rqP3ezbwUSyVJG4gNP8HERU4OlKhe0goZxwlgTxTSoaBMdfDX8mL7pmIv/UPV20vA0ZB/bAMrApZ5 St3czCaRQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnQG-0003kL-Nl; Thu, 03 Sep 2020 11:28:56 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOk-0002sJ-PK for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132389; 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=MzaZBt+Vyi1bRqVISe2Fhrcj5nalR7mOXK01fT+I730=; b=u8iCRRQvzhTJetNnCDlzS4aOGpt9kMtxOzQtSUhUSS2708Uf/R1hUN9yNoUEzxH9j8Wurs bP70nLXTelzEqs3l15brpmwIMzH8VMQP0sGzQ5B44n0Af2Kziq6zlHcFO9bbroNYRUbjcc aOcSVghkpsh25/9qc43DoY6iNOOh1tM= 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 10/20] usb/musb: da8xx: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:44 +0200 Message-Id: <20200903112554.34263-11-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_072722_977529_5C439314 X-CRM114-Status: GOOD ( 13.95 ) 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/musb/da8xx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 1c023c0091c4..7a13463006e3 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -598,8 +598,7 @@ static int da8xx_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int da8xx_suspend(struct device *dev) +static int __maybe_unused da8xx_suspend(struct device *dev) { int ret; struct da8xx_glue *glue = dev_get_drvdata(dev); @@ -612,7 +611,7 @@ static int da8xx_suspend(struct device *dev) return 0; } -static int da8xx_resume(struct device *dev) +static int __maybe_unused da8xx_resume(struct device *dev) { int ret; struct da8xx_glue *glue = dev_get_drvdata(dev); @@ -622,7 +621,6 @@ static int da8xx_resume(struct device *dev) return ret; return phy_power_on(glue->phy); } -#endif static SIMPLE_DEV_PM_OPS(da8xx_pm_ops, da8xx_suspend, da8xx_resume); @@ -641,7 +639,7 @@ static struct platform_driver da8xx_driver = { .remove = da8xx_remove, .driver = { .name = "musb-da8xx", - .pm = &da8xx_pm_ops, + .pm = pm_ptr(&da8xx_pm_ops), .of_match_table = of_match_ptr(da8xx_id_table), }, }; From patchwork Thu Sep 3 11:25:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753375 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 5CF97722 for ; Thu, 3 Sep 2020 11:29: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 31A8D2083B for ; Thu, 3 Sep 2020 11:29: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="aBnTeDkD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="p43itBv7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31A8D2083B 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=iJeRa0r9Afet4aYGBXhf5ULBan2rqatDTq+JRBDxdag=; b=aBnTeDkDLtobGjs51TQZLTMHx l5FkpBhVJU2Ltw2PCnSOBCUaLCwUA7N5Pi/0VBEBQDlhY9dg7RyMnSZWr/lLnEgQ+/bapTTzatiCO oU/vdI/ngcYlpCi8AI0Etnmz1OfDAMAwu96th1AFvkM/91lci7hARsgZmRRIVSO28binC+hbEWqs4 TvgqLbc+a7T6V7GfgEfAh/Yg2DVt5i/tb0mpS7zyz7ngQSGefZ4sAHfgcH8l2sB4IDMC3JVcVoYHe hcJF7fZGpM06XstmrTxZwvNP7ArlhummZz1h32kJmZOjvmRYoOTgj/G2mdlbUyuVAEgqHEq5e2GTm R/+/NlEDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnQO-0003t7-O7; Thu, 03 Sep 2020 11:29:04 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOr-0002wd-JN for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132392; 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=9XW0R3A7h61kqVO9LHIfPbKDh6AHGGvcxGKCBLPMwEw=; b=p43itBv7pIcpgpQk29PzyvPKV0bvvqU7w2NCQtGv28IZlDXG/g383913UyPEdgcZy94ccQ wWQOhhbDp8JG5qUeiMANp5kO0L3OYfS3eVJPL5lXk2mG+o/wGUWDI+myv9l6KgdOj40ue3 KU6GbN4Ags8dJ5BehODyZ4GCKabfjO4= 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 11/20] usb/musb: musb_dsps: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:45 +0200 Message-Id: <20200903112554.34263-12-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_072729_839602_E95F0C36 X-CRM114-Status: GOOD ( 14.80 ) 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/musb/musb_dsps.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 30085b2be7b9..cb196bb6661d 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -665,26 +665,22 @@ dsps_dma_controller_create(struct musb *musb, void __iomem *base) return controller; } -#ifdef CONFIG_PM_SLEEP -static void dsps_dma_controller_suspend(struct dsps_glue *glue) +static void __maybe_unused dsps_dma_controller_suspend(struct dsps_glue *glue) { void __iomem *usbss_base = glue->usbss_base; musb_writel(usbss_base, USBSS_IRQ_CLEARR, USBSS_IRQ_PD_COMP); } -static void dsps_dma_controller_resume(struct dsps_glue *glue) +static void __maybe_unused dsps_dma_controller_resume(struct dsps_glue *glue) { void __iomem *usbss_base = glue->usbss_base; musb_writel(usbss_base, USBSS_IRQ_ENABLER, USBSS_IRQ_PD_COMP); } -#endif #else /* CONFIG_USB_TI_CPPI41_DMA */ -#ifdef CONFIG_PM_SLEEP -static void dsps_dma_controller_suspend(struct dsps_glue *glue) {} -static void dsps_dma_controller_resume(struct dsps_glue *glue) {} -#endif +static void __maybe_unused dsps_dma_controller_suspend(struct dsps_glue *glue) {} +static void __maybe_unused dsps_dma_controller_resume(struct dsps_glue *glue) {} #endif /* CONFIG_USB_TI_CPPI41_DMA */ static struct musb_platform_ops dsps_ops = { @@ -961,8 +957,7 @@ static const struct of_device_id musb_dsps_of_match[] = { }; MODULE_DEVICE_TABLE(of, musb_dsps_of_match); -#ifdef CONFIG_PM_SLEEP -static int dsps_suspend(struct device *dev) +static int __maybe_unused dsps_suspend(struct device *dev) { struct dsps_glue *glue = dev_get_drvdata(dev); const struct dsps_musb_wrapper *wrp = glue->wrp; @@ -996,7 +991,7 @@ static int dsps_suspend(struct device *dev) return 0; } -static int dsps_resume(struct device *dev) +static int __maybe_unused dsps_resume(struct device *dev) { struct dsps_glue *glue = dev_get_drvdata(dev); const struct dsps_musb_wrapper *wrp = glue->wrp; @@ -1024,7 +1019,6 @@ static int dsps_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(dsps_pm_ops, dsps_suspend, dsps_resume); @@ -1033,7 +1027,7 @@ static struct platform_driver dsps_usbss_driver = { .remove = dsps_remove, .driver = { .name = "musb-dsps", - .pm = &dsps_pm_ops, + .pm = pm_ptr(&dsps_pm_ops), .of_match_table = musb_dsps_of_match, }, }; From patchwork Thu Sep 3 11:25:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753377 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 EA661722 for ; Thu, 3 Sep 2020 11:29:40 +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 BF560208B3 for ; Thu, 3 Sep 2020 11:29:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mog+1P1x"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="M/kfg7wa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF560208B3 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=A6dZz4fpt83NFfkG13B9vRoRBQkKS+CRRB7LoIhI0m4=; b=mog+1P1x2vkFemJIQOhtBVpuF n7KsKKK5zDiRMz4h2BSP1R1cBf8SBHhxUBEBQwnur7DvGFzTLrtQHBQN+zYQD1HzrGZouMpmOh9Fw AsJACupNMH2XuOPO3muyKmzSgFYUxYL86qiMRGQej8UVf1VTmAirTqOk/cigpM1SLE1cUpHTf8rtU MqOKu2GjlAv9aateuqn3Fc6apyx+ahCtgLiaYGNKprfTnlH3MRnO890Yh8BGJOgc5HDCfJMB7JICh 3n1KwM0clAacuCbP6bEmf0iMG1frWeGEXQB2AggQzQs4QwELD5HXDzQq2mlG5fhIEUAoi/f8AWxED aHc7PGMyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnQj-00044F-PR; Thu, 03 Sep 2020 11:29:25 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnOy-00031S-TM for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132394; 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=utgKzOLLgksdIlgLwCETskaSs78Yqz7cFo3jO08OUyA=; b=M/kfg7waEBVPPqIV29RKlzuq3XReCvGUEPpjSph3PabopjIxrBkgzq9CYDplp1G5OYhDNf aHBI9oaDeg83VY3j4WmlVnJVSOYEoVhQXX1bSJSmMQWYhx0lP9O1oReKYaOzr1AWZcjU6T XX8DWnJ6kqxSyv/lG6knaAdaaNawWu4= 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 12/20] usb/musb: ux500: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:46 +0200 Message-Id: <20200903112554.34263-13-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_072737_526743_848020B5 X-CRM114-Status: GOOD ( 13.99 ) 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/musb/ux500.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index 73538d1d0524..3defe83f3a16 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -327,8 +327,7 @@ static int ux500_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int ux500_suspend(struct device *dev) +static int __maybe_unused ux500_suspend(struct device *dev) { struct ux500_glue *glue = dev_get_drvdata(dev); struct musb *musb = glue_to_musb(glue); @@ -341,7 +340,7 @@ static int ux500_suspend(struct device *dev) return 0; } -static int ux500_resume(struct device *dev) +static int __maybe_unused ux500_resume(struct device *dev) { struct ux500_glue *glue = dev_get_drvdata(dev); struct musb *musb = glue_to_musb(glue); @@ -358,7 +357,6 @@ static int ux500_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(ux500_pm_ops, ux500_suspend, ux500_resume); @@ -374,7 +372,7 @@ static struct platform_driver ux500_driver = { .remove = ux500_remove, .driver = { .name = "musb-ux500", - .pm = &ux500_pm_ops, + .pm = pm_ptr(&ux500_pm_ops), .of_match_table = ux500_match, }, }; From patchwork Thu Sep 3 11:25:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753379 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 85000722 for ; Thu, 3 Sep 2020 11:29:48 +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 5AE07208B3 for ; Thu, 3 Sep 2020 11:29:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ynLLmmzH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="TdDiNKC/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AE07208B3 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=GrBLZN7NqTRZqZGexcLZvweI6U5SiVbw+UN0Y7Zhx8Q=; b=ynLLmmzHUJV+SYZmERB3q6Y7M Owwyx2iUjBRyFT7QCltIPPKUXUkzrdr7zBjLPGd1NEi7VShjW+TZroYBrNGV8Ufpa7UWCqDIhuhQR JpbTA8IDlTyLIH8svk+QTTGmmruXKvcca8g86YGZpJte7rAiF9M+Gz9eAJ7AZM9c9WgxDQMcj3Lb1 CeV+ExRlbCyV3LjbUVllJBHzMDTMfue0wlxYxENgdEYrLWsZKKCIND2atxDfT95202N4LXQP5kD4y ejvS4Ix2+C31cYEoL9WufOEg8qng5C4PbHET9iORRB6moZIjZT1f9nWHis1PsyZFjHnOaSabXozb9 jLAbO4biA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnQq-00049b-5y; Thu, 03 Sep 2020 11:29:32 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnP6-00036B-JH for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132397; 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=So1ydkKuCEbYZRfPCMaB7KCDvSR7hgpAAFNtUES9lnU=; b=TdDiNKC/us7YKeyMnnsJ+Gvaf3XEHP0+ivVh03DILw/6xdyhGyQYHfRGGRBxn4+7b7Tgdm wwZTFIbsD9ztA92cvXnUd128sxT5s47A/ML1Xf6o+EBbRib8GKDkXWG0m7A4xoDPlpv154 0sKvjhacukZekWOSySQ8noyCTQC5i+U= 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 13/20] usb/phy: am335x: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:47 +0200 Message-Id: <20200903112554.34263-14-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_072744_833267_3ACE1DEF X-CRM114-Status: GOOD ( 14.27 ) 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/phy/phy-am335x.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 8524475d942d..a238f866634b 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -90,8 +90,7 @@ static int am335x_phy_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int am335x_phy_suspend(struct device *dev) +static int __maybe_unused am335x_phy_suspend(struct device *dev) { struct am335x_phy *am_phy = dev_get_drvdata(dev); @@ -111,7 +110,7 @@ static int am335x_phy_suspend(struct device *dev) return 0; } -static int am335x_phy_resume(struct device *dev) +static int __maybe_unused am335x_phy_resume(struct device *dev) { struct am335x_phy *am_phy = dev_get_drvdata(dev); @@ -122,7 +121,6 @@ static int am335x_phy_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume); @@ -137,7 +135,7 @@ static struct platform_driver am335x_phy_driver = { .remove = am335x_phy_remove, .driver = { .name = "am335x-phy-driver", - .pm = &am335x_pm_ops, + .pm = pm_ptr(&am335x_pm_ops), .of_match_table = am335x_phy_ids, }, }; From patchwork Thu Sep 3 11:25:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753381 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 6AA4F14E3 for ; Thu, 3 Sep 2020 11:30:00 +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 3F1632083B for ; Thu, 3 Sep 2020 11:30:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iSdx/Z97"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="u9xFXq2E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F1632083B 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=Stx6HX1Yj+yb79tSLNvzVwlCqUFAFpj8ZQ7HCZRh1Mo=; b=iSdx/Z97mdBmESY5avkPOiumO qDWwVAY3728COrPKNPMH4kRWflo/fAQAqSIKBXsnKqQHPFeBRgXyip6wImz2q1D4B4XQOtQvIYhrA YFn4UmzCKKLjgxhHYENbEm7zAlkFrUdQ2+9kwdN1cUWH6mcWajZpRA8UO+Q7KtkmwydNanJy085LW MYh2WPGPQ5r7aEIU9a0lPHkYQwuCrlUXl/lWxjCI4EvkS8DisZ+vvrZlsE1UADps/X2yttcawaVDR vIz0Qz9SqkFZIypyMZew/Cy+zeifCtyahZ2ZXHmM3gxtjv+r6ij8HWoj++ulFC75kVSCHsjjKQ9vR yOOvH2ZKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnQx-0004Dc-Qf; Thu, 03 Sep 2020 11:29:40 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPE-0003BK-5K for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:27:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132400; 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=kBW+nkOsYyeAelK/KG7Nm9NdYHdCT7/Y8hAy7PO36OI=; b=u9xFXq2EP+7d+LmlwYPr2PlDeGx8LofH5vlp6CbMdTA7PVyuq7p56wjFh7Kr3Iz/7YZUHh 6PAiCm4bE5jSsLrmXg3T1mnmLyfJvsTxHh36tbIvQn2EKg4aNICx1RVLaBCkornN3obBEM cDJ9dheuf5Xxpis21nnQ1SKic7lnxyY= 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 14/20] usb/phy: mxs-usb: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:48 +0200 Message-Id: <20200903112554.34263-15-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_072752_397779_31F8ED14 X-CRM114-Status: GOOD ( 15.30 ) 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 Acked-by: Peter Chen Acked-by: Felipe Balbi --- drivers/usb/phy/phy-mxs-usb.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 67b39dc62b37..c5e32d51563f 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c @@ -815,8 +815,8 @@ static int mxs_phy_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static void mxs_phy_enable_ldo_in_suspend(struct mxs_phy *mxs_phy, bool on) +static void __maybe_unused +mxs_phy_enable_ldo_in_suspend(struct mxs_phy *mxs_phy, bool on) { unsigned int reg = on ? ANADIG_ANA_MISC0_SET : ANADIG_ANA_MISC0_CLR; @@ -832,7 +832,7 @@ static void mxs_phy_enable_ldo_in_suspend(struct mxs_phy *mxs_phy, bool on) reg, BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG_SL); } -static int mxs_phy_system_suspend(struct device *dev) +static int __maybe_unused mxs_phy_system_suspend(struct device *dev) { struct mxs_phy *mxs_phy = dev_get_drvdata(dev); @@ -842,7 +842,7 @@ static int mxs_phy_system_suspend(struct device *dev) return 0; } -static int mxs_phy_system_resume(struct device *dev) +static int __maybe_unused mxs_phy_system_resume(struct device *dev) { struct mxs_phy *mxs_phy = dev_get_drvdata(dev); @@ -851,7 +851,6 @@ static int mxs_phy_system_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static SIMPLE_DEV_PM_OPS(mxs_phy_pm, mxs_phy_system_suspend, mxs_phy_system_resume); @@ -862,7 +861,7 @@ static struct platform_driver mxs_phy_driver = { .driver = { .name = DRIVER_NAME, .of_match_table = mxs_phy_dt_ids, - .pm = &mxs_phy_pm, + .pm = pm_ptr(&mxs_phy_pm), }, }; From patchwork Thu Sep 3 11:25:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753385 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 8A2E414E3 for ; Thu, 3 Sep 2020 11:30:17 +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 5B55E2083B for ; Thu, 3 Sep 2020 11:30:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kn7MpEM/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="l7Tbgxzp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B55E2083B 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=Cal5VfWEzac/0n3JsMumA5j6nGZsC1rASLV5EiCakjk=; b=kn7MpEM/CnIPhSdBl9vswzffK XXBKFM5GcwWRP5uLwqHTGfilyArbp/UkbcMq/gu5pD1oi3k9xWgnauyXsTWiDgTWBBumbVElPOtrs sba+eA3O93byyM7RHQSDlo5jKBOPjXip+48fph7NrZdPgljM3gRDH3O0iyK0vm1S2+Cb9tNonQsZq RkYSv1lmEx4Mxy/ZwVwjmfFUPed77wCFYVdiQdYp/yJ9mJii46XtNHehhfrBtKxPASfj8qN514gUA re8n8IaILAkOpBcjU+aBIEFL7i6wc6blB5JH49Gq6ycCi4eNa9sQXXhDtCab7eeWpb+4cf6omgWoj 9EbhQWoyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnRE-0004Po-LE; Thu, 03 Sep 2020 11:29:56 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPM-0003GA-Cf for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:28:01 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_072800_611492_AEE459CB X-CRM114-Status: GOOD ( 13.78 ) 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/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, }, }; From patchwork Thu Sep 3 11:25:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753389 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 3D95C14E3 for ; Thu, 3 Sep 2020 11:30:35 +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 11CC8206A5 for ; Thu, 3 Sep 2020 11:30:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e6zHXPHD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="bNYvg+rq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11CC8206A5 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=Eo/4dxTvH4Y7+e01JxSdGEM2vmgdclHZDgk2Et8BrhA=; b=e6zHXPHD+PT3Q3poDFs/HXxyQ eS9zRERvZ2xzhXgnIQRnqzfYhhTb1IiJ6wAp0WDVH8EdBYKNMVRU7lwuiCzwtuXSiRXDUlYRFF1n5 x741mHE5HynIVKRue4FOE1QFUPqB+tA/VkrIAoPvA4bgeQ6gSVO/ewnlbU0CJ4QFWutFcrMVIr9cG iXkwR+bYoYykDfFkS76nbOD6KXEth/xYPcut0V++9zQFj55ygVAIPY0TRj7P0UiQ+tY4K+rrngT62 K7pGRMgEtNLPK4DVu7rQc1I8yInjEuploIZSNH1NZs4ekmL6czG0Z2X1D4LpnvX08rKXJtGU7PwLH wmAtzAybg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnRZ-0004aw-66; Thu, 03 Sep 2020 11:30:17 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPU-0003Li-15 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:28:09 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_072808_479554_80F662B4 X-CRM114-Status: GOOD ( 14.49 ) 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/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, From patchwork Thu Sep 3 11:25:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753391 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 7508414E5 for ; Thu, 3 Sep 2020 11:30:45 +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 47E57206A5 for ; Thu, 3 Sep 2020 11:30:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VvvWppoG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="Vx2UPtjt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47E57206A5 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=wBCUZ73ryTA+iDbnC1r16JLNXbN0HXsxdPK9XCjoLwU=; b=VvvWppoGtIn+babw5EEXhWMOM n3bCyp5jWTGVgXxoOdi2ecudPfvA758z68CHbF5247iVj85mFZn7V/ETBT9t7/VQWlUZYmm5Vganf adIvgHJdwLvgnZ60/tdVunqL/Qkd7YDPM4/3q3vytaw95Q8H53K50SN2s+LE7fqGmWeWoFPF1I6F6 Jp2Qe6gQEXzRqv0FbZ8QLuWSYxiUkAC0JLMpACUI8qWsbar0/Nz57eP/zsldX0dQyU61b5PgKRK29 UZe9dnc5mcWoKp3sh4bgXDr5XroB8I9cyz2zJU0YQG6bTRyI2cLv+s0HGp14tOdvrNflwiLADftTB ErOp7YcZg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnRl-0004m1-GA; Thu, 03 Sep 2020 11:30:29 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPd-0003RW-3M for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:28:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132408; 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=zOk90+M51eZ5tI9ivTHZKHwy00IhaQlS+1+ArcDDDCo=; b=Vx2UPtjtliAswHBk8SZCaP2DvtJN/jS6azp/jPeSUY3YkmCg1BzYIeaJpaw714tuYK6Qx+ 0klYFlkQoHxQb+65paN2wu1ttyLFHuygxhLsf0p7lfhCwwhL2+WeAod4Kqkx5M4WFpPvhz M5pLVSy7NtvEdOvBNIZc0rt4QQ/FUAI= 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 17/20] usb/gadget/udc: mv-u3d: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:51 +0200 Message-Id: <20200903112554.34263-18-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_072817_736660_F451ADDF X-CRM114-Status: GOOD ( 14.07 ) 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/mv_u3d_core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c index 5486f5a70868..a7e3736fd0c1 100644 --- a/drivers/usb/gadget/udc/mv_u3d_core.c +++ b/drivers/usb/gadget/udc/mv_u3d_core.c @@ -1988,8 +1988,7 @@ static int mv_u3d_probe(struct platform_device *dev) return retval; } -#ifdef CONFIG_PM_SLEEP -static int mv_u3d_suspend(struct device *dev) +static int __maybe_unused mv_u3d_suspend(struct device *dev) { struct mv_u3d *u3d = dev_get_drvdata(dev); @@ -2012,7 +2011,7 @@ static int mv_u3d_suspend(struct device *dev) return 0; } -static int mv_u3d_resume(struct device *dev) +static int __maybe_unused mv_u3d_resume(struct device *dev) { struct mv_u3d *u3d = dev_get_drvdata(dev); int retval; @@ -2031,7 +2030,6 @@ static int mv_u3d_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(mv_u3d_pm_ops, mv_u3d_suspend, mv_u3d_resume); @@ -2051,7 +2049,7 @@ static struct platform_driver mv_u3d_driver = { .shutdown = mv_u3d_shutdown, .driver = { .name = "mv-u3d", - .pm = &mv_u3d_pm_ops, + .pm = pm_ptr(&mv_u3d_pm_ops), }, }; From patchwork Thu Sep 3 11:25:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753393 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 3200F14E3 for ; Thu, 3 Sep 2020 11:31:00 +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 D5537206A5 for ; Thu, 3 Sep 2020 11:30:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KYhXGh3W"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="htUjP8MO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5537206A5 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=h5V8ThMPdGBdhdKfX1Ix8EgoGt2u/7/VBfb+SgjS30M=; b=KYhXGh3WhGRuYL7vaFoWYahzG 8+GwD/cJj18aZGpBnzsli15hH58Yn9Z6gpmv55FM0RZlH0ebf4+gV63u827b5NBeHiMuWbJ5HqdAI 5va2MuAJGfezjD6sCUU1qgONYuyLR2pJlBfpJ8+Z7CsRP2tgo0zZJ6u6oBtpmFdXyEB/odcWrh28P R2cQZX/xZjoWOo7fXAvk2iWzUPS73/qpcqh+wvH1AJD4+/r8HkSRdBnnTZba8VEQlOu+T8EZWLDQV AkNgZbZ64eCWg79BCbFLobmV2Ymeeot/AwCsr7FqsieuvA9WTGUL1x/40S4hRNgt3ZUBRzzjP++7o WLNZ08d4w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnRw-0004ta-K3; Thu, 03 Sep 2020 11:30:40 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnPl-0003Wc-WE for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:28:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132411; 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=RNukebu5FJc21AaatW8pIDM/jN+mPnsQcQWuh8bpr7A=; b=htUjP8MOznKj63TiyERDMqJINFETb7XOkyxP8ClwaFkoSfOGrFLr+VLzUvyD3xNeQSswbg p7LZQ5cWe25wPNMfmzaec40O/ElUOkQRnNQGhJbuEk9+6OaARXOMTpUdcXLUSy2DnephH1 XwmA8yVt8pDGFouQrnH2pvmVwN+h2mo= 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 18/20] usb/gadget/udc: pch: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:52 +0200 Message-Id: <20200903112554.34263-19-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_072826_445479_D76A488F X-CRM114-Status: GOOD ( 13.74 ) 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/pch_udc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index 8afc31d94b0e..9e26b5ab3058 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -3042,8 +3042,7 @@ static void pch_udc_remove(struct pci_dev *pdev) pch_udc_exit(dev); } -#ifdef CONFIG_PM_SLEEP -static int pch_udc_suspend(struct device *d) +static int __maybe_unused pch_udc_suspend(struct device *d) { struct pch_udc_dev *dev = dev_get_drvdata(d); @@ -3053,16 +3052,12 @@ static int pch_udc_suspend(struct device *d) return 0; } -static int pch_udc_resume(struct device *d) +static int __maybe_unused pch_udc_resume(struct device *d) { return 0; } static SIMPLE_DEV_PM_OPS(pch_udc_pm, pch_udc_suspend, pch_udc_resume); -#define PCH_UDC_PM_OPS (&pch_udc_pm) -#else -#define PCH_UDC_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ static int pch_udc_probe(struct pci_dev *pdev, const struct pci_device_id *id) @@ -3171,7 +3166,7 @@ static struct pci_driver pch_udc_driver = { .remove = pch_udc_remove, .shutdown = pch_udc_shutdown, .driver = { - .pm = PCH_UDC_PM_OPS, + .pm = pm_ptr(&pch_udc_pm), }, }; 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), }, }; From patchwork Thu Sep 3 11:25:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11753401 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 CFE1A14E5 for ; Thu, 3 Sep 2020 11:34:03 +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 A4A1B206A5 for ; Thu, 3 Sep 2020 11:34:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2/GKG3ks"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="uyPH2gOX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4A1B206A5 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=9e4RlhyWNxui9QvXGoXY8mHNqVyO2Bnlzgqr+NtqSts=; b=2/GKG3ksP8fgkkxMLGqTYbf37 L+/my9rkjeTeq9cnB90D5yaYoImGvXPJg0tc+ls/91hDtYDJnBcDY/DMD978uuDY4aX7z7YmyMent cq3j90zLxip4iCNVFMFB0DgfZebNMhvFf0MrXoVf7FykAEiDe8SXx9HlAOk6QVtC5hlp0tQ7JVlcA Od6O1jdOMFfr9jxuQ2uaB95gMuYHXEGXJR6S1CgX9i71CUlE+6H4le27X8fuxIXfOUuJy1X0ns/X+ E33l1A18aHZmnPophE8C/C6Uyb8mgUuctjxvQYBJj20Tz7tk6QpbHGAuMCwOEHysxZd83d8QkJsJ5 iOjph7lnw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnT0-0005U3-Ej; Thu, 03 Sep 2020 11:31:46 +0000 Received: from crapouillou.net ([89.234.176.41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDnQ6-0003hf-Ci for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 11:28:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599132416; 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=d/usum2lMn5S572mPjualJXpI8Hb8PYrLN5qLjcBg/E=; b=uyPH2gOXuLKzSt6R9ogD6oYnN48BacMq2YCnxfq+SGRV9cExif4lnLNhWfRYfiVN93vpTU iNEmJHYhwhvBHbRXKzQno5TLuA3CiRE064g8znLpMhPwYtZ6Op5Vc612zeV2FlJUHU6NF7 kv1P84KdA4TY9WoGREISDXYqyfPPtow= 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 20/20] usb/gadget/udc: snps: Use pm_ptr() macro Date: Thu, 3 Sep 2020 13:25:54 +0200 Message-Id: <20200903112554.34263-21-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_072846_829704_6FD146AC X-CRM114-Status: GOOD ( 14.09 ) 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/snps_udc_plat.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c index 32f1d3e90c26..6b8f08287c84 100644 --- a/drivers/usb/gadget/udc/snps_udc_plat.c +++ b/drivers/usb/gadget/udc/snps_udc_plat.c @@ -257,8 +257,7 @@ static int udc_plat_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int udc_plat_suspend(struct device *dev) +static int __maybe_unused udc_plat_suspend(struct device *dev) { struct udc *udc; @@ -275,7 +274,7 @@ static int udc_plat_suspend(struct device *dev) return 0; } -static int udc_plat_resume(struct device *dev) +static int __maybe_unused udc_plat_resume(struct device *dev) { struct udc *udc; int ret; @@ -302,11 +301,8 @@ static int udc_plat_resume(struct device *dev) return 0; } -static const struct dev_pm_ops udc_plat_pm_ops = { - .suspend = udc_plat_suspend, - .resume = udc_plat_resume, -}; -#endif + +static SIMPLE_DEV_PM_OPS(plat_pm_ops, udc_plat_suspend, udc_plat_resume); #if defined(CONFIG_OF) static const struct of_device_id of_udc_match[] = { @@ -324,9 +320,7 @@ static struct platform_driver udc_plat_driver = { .driver = { .name = "snps-udc-plat", .of_match_table = of_match_ptr(of_udc_match), -#ifdef CONFIG_PM_SLEEP - .pm = &udc_plat_pm_ops, -#endif + .pm = pm_ptr(&udc_plat_pm_ops), }, }; module_platform_driver(udc_plat_driver);