From patchwork Tue Apr 18 09:19:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13215293 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 BB0B7C77B75 for ; Tue, 18 Apr 2023 09:21:18 +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=E0VNzVajtxUWhxih6p+Vtk/INhHQyVXQNXUYusGtqr8=; b=aNTN8ShVomSNPE +98on1ktcbymIdHk0M0iu26qM7YNy6bjMAEgTKspYczJxW0lYn7RQ254RpnXvPTMX79ADqLgDBNgh ge0KHqIP/IsSyL4ayMA1jmrjHhMy9heW+S73+aSt+YFJGoZQ/QTX2M4kLA2DND2hTkwUH+iGLhRd0 VvSDcKmSssKKt1WN41jCE3TiDPZrKiyWIyA09w+TLUIc2UTLlns7uhDeLo1Cuav59pkSg4FiBgY5F 3my3dEgzua+xgJ0H8s/XsoJF2MW4weeZHC7GhHHMDxzrBHex5kNPwIT6ZscFu+pxBiGyOIfQyVCFU oThv+EsJsNXPfgwGz7kA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pohVZ-001RKi-2D; Tue, 18 Apr 2023 09:20:17 +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 1pohVX-001RJt-2L for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 09:20:17 +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 379D062F17; Tue, 18 Apr 2023 09:20:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 467C0C433EF; Tue, 18 Apr 2023 09:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681809614; bh=8drEH5aCAxwicYtAScB7NeX/7oZUwCh5bk+LwTxOi1o=; h=From:To:Cc:Subject:Date:From; b=C52CuVbR0PeY3hp5sp2aOcChsv/vBhbh15faoi0ESQVuvK49l6JIuuW1rsHSmFCuN IkpyYOTR76vwFvnOkI6QkhmRcbT1vfw3rBhZMKg+etQL8JwzM2Xdpte8QVvoBSOQJZ iQ7vT4eEaPrKi9L4T0ucnO0LDEG4eFx0tS8NE8pe+UuOHOO6DURdmShWwGHjxgA7go azCXTavQBZX6xkzy2OGY1R3Eu3/24j11v1IYS1Q79y98VXhQkwJSqISTWPLhaxnPNL 3s3/MFc9IR7RhnO6ynD0+6Z12PRPJu5oQGAItMRP+SHn5/Ohn2L9qDi9Ev53gnM91R HXMFrUnD9IRJQ== From: Arnd Bergmann To: Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Christian Hemp , Stefan Riedmueller , Jacopo Mondi , Dong Aisheng Cc: Arnd Bergmann , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Guoniu Zhou , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v3] media: nxp: ignore unused suspend operations Date: Tue, 18 Apr 2023 11:19:55 +0200 Message-Id: <20230418092007.2902984-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-20230418_022015_835778_863A085F X-CRM114-Status: GOOD ( 15.13 ) 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 gcc warns about some functions being unused when CONFIG_PM_SLEEP is disabled: drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c:328:12: error: 'mxc_isi_pm_resume' defined but not used [-Werror=unused-function] 328 | static int mxc_isi_pm_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c:314:12: error: 'mxc_isi_pm_suspend' defined but not used [-Werror=unused-function] 314 | static int mxc_isi_pm_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~ Use the modern SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() helpers in place of the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() ones. By convention, use pm_ptr() to guard the reference to the operations. This makes no difference as long as the driver requires CONFIG_PM, but is what users of SET_RUNTIME_PM_OPS() are supposed to do. Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver") Reviewed-by: Laurent Pinchart Signed-off-by: Arnd Bergmann --- v3: update changelog text v2: Laurent and me both sent a v1 --- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c index 238521622b75..253e77189b69 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c @@ -378,8 +378,8 @@ static int mxc_isi_runtime_resume(struct device *dev) } static const struct dev_pm_ops mxc_isi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume) - SET_RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume) + RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL) }; /* ----------------------------------------------------------------------------- @@ -528,7 +528,7 @@ static struct platform_driver mxc_isi_driver = { .driver = { .of_match_table = mxc_isi_of_match, .name = MXC_ISI_DRIVER_NAME, - .pm = &mxc_isi_pm_ops, + .pm = pm_ptr(&mxc_isi_pm_ops), } }; module_platform_driver(mxc_isi_driver);