From patchwork Fri Nov 18 16:16:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9437007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1D1F60237 for ; Fri, 18 Nov 2016 16:18:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2821299A0 for ; Fri, 18 Nov 2016 16:18:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C488D299A6; Fri, 18 Nov 2016 16:18:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D39D299A0 for ; Fri, 18 Nov 2016 16:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753915AbcKRQSF (ORCPT ); Fri, 18 Nov 2016 11:18:05 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:52888 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752502AbcKRQSE (ORCPT ); Fri, 18 Nov 2016 11:18:04 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0LnFph-1chwTs1AlR-00hJse; Fri, 18 Nov 2016 17:17:21 +0100 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Minghsiu Tsai , Houlong Wei , Andrew-CT Chen , Matthias Brugger , Hans Verkuil , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] [media] mtk-mdp: mark PM functions as __maybe_unused Date: Fri, 18 Nov 2016 17:16:06 +0100 Message-Id: <20161118161621.798004-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161118161621.798004-1-arnd@arndb.de> References: <20161118161621.798004-1-arnd@arndb.de> X-Provags-ID: V03:K0:ejWZnEEoYBz2pxgPvAkfHeiCj8AFcTeBy0M/D3bIYU/OsTz/nKy lQ05nY1BwEywUESo3e8XES9UVInNAilOEPgrmO5iHxdUl9F9qAktnevQnQMrjZfxBG74wwO KGgtIFg8cmEMz/LMI66T4igrB5qFDb297gmi+jSQguQ26zk2zEK3igVkkZvj1yJ4V0k7SDr ShXnZQ69pxfg+s1T7hEuA== X-UI-Out-Filterresults: notjunk:1; V01:K0:lAtxDFWToS0=:/uGzEwPFe7ZgdF8CztZ20Y ThEV9ik7HZwZiNGDNo7Rg/vigj9ewMKw7bbC1hXbNK4SIxVRRgH1Dq/lqsp53DRoliWq1gZeJ 8F2fXtB0PircZa4h+WJXbeF+oaqkMpnBk1DJrYk6wijhbNg8wl5m7D0bnM6NfBTyK3SrjdAGi yfDqik2DTFgjFUAgZRKvrtY5dyrl2IlIvbT5mXSC4ZyY6ZHWfdCzQfdzQXKuqAkY48v9XNKmw WgdzAKDqPdFeGbh39o3Ifpqn0IpnIEp+1lH9QnjgasQ/ELmkeKGTtB2CYxeg36/VkGjLzm6A4 TutImJBwH+4GclQiku8n5vxsjWHkheZs+KnnEBbvs6xIl+a04xrPJ8QrFjcxFWiq0ifxifjs1 CYTd28OYWiVRglpHmgSE0FuV9IS3Q2PqLmdNhyl8uQMMHTQkD4QKmD4sD2KFGYcF7Oz7u+0dO YqGoMHXPH4WGhpL2ZpwDPgQabU7kdPdSSvhfnmuzs11eEd/sczNxItAow6hafye3Y6SqS8zGT hwqWkqjU0fdo0zhKjv8hG2LM3kCi8VMSI35SYU4olRAUS3hlR/sTj6xIucinP61hbhfbb5yOw FbHnoMai6LYmiuC4IVhRytytYwHznA8Gc4QLHr6cQ/Wqmf70JfcZ1S+nLlOsenzFtCr5RexhE XbXe6SK0PtmSwEiy2MaqypQhEjPoa7Sgmvg3Toak5hXp7yV4y8n95OKto3BySDC8mdLo= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver still produces a warning when CONFIG_PM is disabled, an earlier fix only partially solved this: media/platform/mtk-mdp/mtk_mdp_core.c:72:13: error: 'mtk_mdp_clock_off' defined but not used [-Werror=unused-function] media/platform/mtk-mdp/mtk_mdp_core.c:63:13: error: 'mtk_mdp_clock_on' defined but not used [-Werror=unused-function] This removes the incorrect #ifdef again and instead marks the PM functions as __maybe_unused, which reliably shuts up the warning. Fixes: 1b06fcf56aa6 ("[media] media: mtk-mdp: fix build error") Signed-off-by: Arnd Bergmann --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 51f2b50e406f..9e4eb7dcc424 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -234,8 +234,7 @@ static int mtk_mdp_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int mtk_mdp_pm_suspend(struct device *dev) +static int __maybe_unused mtk_mdp_pm_suspend(struct device *dev) { struct mtk_mdp_dev *mdp = dev_get_drvdata(dev); @@ -244,7 +243,7 @@ static int mtk_mdp_pm_suspend(struct device *dev) return 0; } -static int mtk_mdp_pm_resume(struct device *dev) +static int __maybe_unused mtk_mdp_pm_resume(struct device *dev) { struct mtk_mdp_dev *mdp = dev_get_drvdata(dev); @@ -252,10 +251,8 @@ static int mtk_mdp_pm_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP -static int mtk_mdp_suspend(struct device *dev) +static int __maybe_unused mtk_mdp_suspend(struct device *dev) { if (pm_runtime_suspended(dev)) return 0; @@ -263,14 +260,13 @@ static int mtk_mdp_suspend(struct device *dev) return mtk_mdp_pm_suspend(dev); } -static int mtk_mdp_resume(struct device *dev) +static int __maybe_unused mtk_mdp_resume(struct device *dev) { if (pm_runtime_suspended(dev)) return 0; return mtk_mdp_pm_resume(dev); } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops mtk_mdp_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mtk_mdp_suspend, mtk_mdp_resume)