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: 86048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp635526vqo; Thu, 20 Apr 2023 14:47:03 -0700 (PDT) X-Google-Smtp-Source: AKy350auZP4TS9YyQRoAMeh7Rjs0jd7PcgewPcqfW0jcBsH1Nf6OA0VRLuO8WnvIrfkncxXAneq7 X-Received: by 2002:a17:902:e80a:b0:1a8:32e:3256 with SMTP id u10-20020a170902e80a00b001a8032e3256mr3634530plg.35.1682027222890; Thu, 20 Apr 2023 14:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682027222; cv=none; d=google.com; s=arc-20160816; b=lPkZWL4sRvHBVsviJblFq2Cz5/O+ApI4fOoXu/Q54iltHIvTF6QigAUddZ3UiSqhSH /nQ9NuqYN3rTd3b9t6hW48uJTrsSJTlTsW0OHv79uTgmKJtS80j7r17NJQOc4il1SVFb 9l8AQc7eVNBrXR2iydWijeFJk5W/EE1/1w+ZjXptU6ouqDVBlBl32BOBKlZb8jEkx2tB IMV2GQYxsMgA5xBSvrD6mloWJS6f8H0O0MzpKFQA942YGtQpnqJDJH1wcFFm8HpBC9t1 hfnz5uAYdZhJ5dd3NplSETnydzOm2JGO/I8mRpyA+YTchSs8XXup/tq3WR5xYHxbPis1 CCHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XA6Mmyz0MzOsmVNJ0Dpgmi64/h0FOR31ROVPEC1ZdYo=; b=yo8aJcQb7xK9k2vlD5Nrul2eINO1eVuRx6rtd2u93Yw3l7I/4bRdsaiclinNt3f1I/ HIMQx1kZLS8ig9HbiheO/J/DV2um5xVv7IDFBtU6e3JvVO3T+kvZEOvcA/8w1dJ1gJER B8KeCLchlqH3efE4TNLbXz5m3hLEI/4mNXNdiN0kMACpHzEJSklCxTyrlgJfyfkh3mRk eycjQrd2joVdZPdAlBil+GIG5+4XG2SQ6ELhqoJVw0F+rmJqURN9SDF1E7MGPGTslm7R 9zFhOd7KthpqqSJ8/0BvIcENMxoM4PLgWFgbcCJ8Q6MshaT714XXq9H3k+qGINuH7XRF NcJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OWspLkkm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a170902f2d100b001a80c0abba4si2499426plc.184.2023.04.20.14.46.45; Thu, 20 Apr 2023 14:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OWspLkkm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231376AbjDTVgW (ORCPT + 99 others); Thu, 20 Apr 2023 17:36:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjDTVgT (ORCPT ); Thu, 20 Apr 2023 17:36:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4883F30D2; Thu, 20 Apr 2023 14:36:18 -0700 (PDT) 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 A4CA464C19; 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763733377136576513?= X-GMAIL-MSGID: =?utf-8?q?1763733377136576513?= 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);