From patchwork Thu Apr 20 21:36:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13219201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70F02C77B73 for ; Thu, 20 Apr 2023 21:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hl98t3WCC0j0VRybIJfjRTF12TxlsNpsSnLb0sJTJLw=; b=rfvHS9UK29disU h0dqeQlKIGMS+80z5rw4motvDVQ1FlLAt3FIRKH/UvoUx9zZTygYiNS8saz6FuozP58hFK8SvwdKm zbjxVDKSicdyGWlAZWjref1Wh94nsfRxgSnQcsfqSgTERjyL4YH6pZ2lKWWhl05b6AmeLZqYUXiIv a/serdYqaa+vBSZZKdF66A2Qm2HQ8/OLkI+cwnALe8lvrmWBbpJvssueBb0bXqRAqHZVH2SWHF8MN pdvcZCq0JZ4Y64p5gvu8RUIQkpfqJ0V6xaxgTw0DzJJmpDb+mNsf3/zIPvYDMXFt/h1gMfItQg0ia tt0+5EHRzhyFi6aJj1nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppbx0-0093K9-0T; Thu, 20 Apr 2023 21:36:22 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppbww-0093Jf-2c for linux-arm-kernel@lists.infradead.org; Thu, 20 Apr 2023 21:36:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A251064C0F; Thu, 20 Apr 2023 21:36:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6B2BC433D2; Thu, 20 Apr 2023 21:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682026577; bh=N4kO0Ct/LnSLCi9T11XBZTUArgxHgmHTQU2AiDujI3o=; h=From:To:Cc:Subject:Date:From; b=OWspLkkmDbLi4PsR/Dq2qnHLUx/tAWfx2lQH1hjad2NuBrOmm4jEe42bR3Wkn4yAH BygNnJjNdNPaHCAI0k94PE7RTWBk51F4r6/w9dHyL8xSlisABkbBqRjHx15Zz06Rxk VA87KAdEenumsUT3r2NhZQ74OgcWzT2kUzapy0XB3WLCHMENFIdga15OCS1nSA0gIJ uJAhWD8R/e9L2XJzZMz0uf0hpN0ymnMPQ2Di3/Yn8Wln8zUpbcixQPsuxCHDm7XYh/ par1g0B7aoCZrH/KxWy93rgcnxN29UWfyvEZdBqjs9hiDzqx5AcnBgau3rBfZ1vlZl h0Yxemfd2B0DQ== From: Arnd Bergmann To: Bjorn Andersson , Mathieu Poirier , Shawn Guo , Sascha Hauer Cc: Arnd Bergmann , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Shengjiu Wang , Iuliana Prodan , Daniel Baluta , Markus Elfring , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: imx_dsp_rproc: use modern pm_ops Date: Thu, 20 Apr 2023 23:36:04 +0200 Message-Id: <20230420213610.2219080-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230420_143618_946931_FEB7C7AD X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann Without CONFIG_PM, the driver warns about unused functions: drivers/remoteproc/imx_dsp_rproc.c:1210:12: error: 'imx_dsp_runtime_suspend' defined but not used [-Werror=unused-function] 1210 | static int imx_dsp_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/remoteproc/imx_dsp_rproc.c:1178:12: error: 'imx_dsp_runtime_resume' defined but not used [-Werror=unused-function] 1178 | static int imx_dsp_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~ Change the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() helpers to their modern replacements that avoid the warning, and remove the now unnecessary __maybe_unused annotations on the other PM helper functions. Signed-off-by: Arnd Bergmann Reviewed-by: Mukesh Ojha Reviewed-by: Iuliana Prodan --- drivers/remoteproc/imx_dsp_rproc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c index cab06dbf37fb..2d75dea43f20 100644 --- a/drivers/remoteproc/imx_dsp_rproc.c +++ b/drivers/remoteproc/imx_dsp_rproc.c @@ -1243,7 +1243,7 @@ static void imx_dsp_load_firmware(const struct firmware *fw, void *context) release_firmware(fw); } -static __maybe_unused int imx_dsp_suspend(struct device *dev) +static int imx_dsp_suspend(struct device *dev) { struct rproc *rproc = dev_get_drvdata(dev); struct imx_dsp_rproc *priv = rproc->priv; @@ -1278,7 +1278,7 @@ static __maybe_unused int imx_dsp_suspend(struct device *dev) return pm_runtime_force_suspend(dev); } -static __maybe_unused int imx_dsp_resume(struct device *dev) +static int imx_dsp_resume(struct device *dev) { struct rproc *rproc = dev_get_drvdata(dev); int ret = 0; @@ -1312,9 +1312,8 @@ static __maybe_unused int imx_dsp_resume(struct device *dev) } static const struct dev_pm_ops imx_dsp_rproc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume) - SET_RUNTIME_PM_OPS(imx_dsp_runtime_suspend, - imx_dsp_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume) + RUNTIME_PM_OPS(imx_dsp_runtime_suspend, imx_dsp_runtime_resume, NULL) }; static const struct of_device_id imx_dsp_rproc_of_match[] = { @@ -1332,7 +1331,7 @@ static struct platform_driver imx_dsp_rproc_driver = { .driver = { .name = "imx-dsp-rproc", .of_match_table = imx_dsp_rproc_of_match, - .pm = &imx_dsp_rproc_pm_ops, + .pm = pm_ptr(&imx_dsp_rproc_pm_ops), }, }; module_platform_driver(imx_dsp_rproc_driver);