From patchwork Fri Apr 21 10:48:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9692435 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 7D6E06037F for ; Fri, 21 Apr 2017 10:50:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C546200E9 for ; Fri, 21 Apr 2017 10:50:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 612AE2860D; Fri, 21 Apr 2017 10:50:07 +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 B29D0200E9 for ; Fri, 21 Apr 2017 10:50:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1038044AbdDUKtf (ORCPT ); Fri, 21 Apr 2017 06:49:35 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:64232 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1037965AbdDUKte (ORCPT ); Fri, 21 Apr 2017 06:49:34 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MhO2U-1cg0zn2tpi-00MYbK; Fri, 21 Apr 2017 12:49:25 +0200 From: Arnd Bergmann To: Alan Cox Cc: Arnd Bergmann , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] staging: atomisp: remove #ifdef for runtime PM functions Date: Fri, 21 Apr 2017 12:48:35 +0200 Message-Id: <20170421104903.815637-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170421104903.815637-1-arnd@arndb.de> References: <20170421104903.815637-1-arnd@arndb.de> X-Provags-ID: V03:K0:WDICWE6YdAvDBaW/0lctKYdt1TOvTx3VX2xHAYeRkHO2V2faXeQ 4LLc9JvAaDG1MUA4a5aNX9rrS69mpjxS6Y7xlVkhwX8cBBXF1SWx8KJK4dQzMQHhxp9LoMn 8Q0M1FoaOPdoM5DkEYiJKBSOwyvOSaiiSMfyO/rNj6dBrbaI7couV4aojyEI12riwZ483Z3 REGuydgD5YA94fDoKRYyg== X-UI-Out-Filterresults: notjunk:1; V01:K0:tDfxf1gEob4=:zwKR9PP/eVQ4vjS9V9neqU mjtZQlzvVFPGXCaN+kN5c2Hn/ZzK/zh3mYqRCrkxFqeRoB9rYG3QxcpMbnDCUOwU8Ftyh6uf2 VCdfz+/96V78lJ3Mr8bYetraqEO4EHI0pRQJuspCGNNXUMyFT/n6f+lCsijpFmy9S22QrihxH XXzDa5FFgD10xOvKGHXbM7I8vAc/M4ieBuvzspq3V/uJfuDcLL9uv1iJmj6VZLoKKesOBVnL8 xhNOjvONuiVTRAcSn/A6qP3ihDqkDihpyG4Wzj791BFDGQRZ2n8n96v2m467dmXEgfoqB3X2K mjNHAKLb88SXp9vJUNHvyeAR5rGRuvmsnNaUqb5b116nUZXZ30BXEXGyH75DN2cW0TEXmLT9U hzSHKBxxHStrERB36FRb/UtFrIHJFyKh3XjxChZM9vkX+fNV50i1CLTfrHGG37JA9RyEQ4rf+ Ytv6gV9IZQKkbndDWY7rjy1/4oMJUroxTmDg/caD3Zvsmz+3gf94yL92dblfUZlIh6k/NZO+x Ah2cnPv5KrGiCGNZzG5rLex2b5e+navR9HKSczDbpB7pT4gtYL4uGpMv+pYh1135dJ47rPQdM 3lNrl6HuMj96uRfUav+qL7yg5wghEXzHUWXEODnYPL5Hv13ouNk2SuzsUUYI5GLQgorGsRmUj qu/u4cAHmIWxmFSX+OZlikPkvpfPC2bjZYCVn0vPCj4AssJOQALWNSMjkBaxVogIW7ow= 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 runtime power management functions are called from the reset handler even if CONFIG_PM is disabled, leading to a link error: drivers/staging/built-in.o: In function `atomisp_reset': (.text+0x4cd1c): undefined reference to `atomisp_runtime_suspend' drivers/staging/built-in.o: In function `atomisp_reset': (.text+0x4cd3a): undefined reference to `atomisp_mrfld_power_down' drivers/staging/built-in.o: In function `atomisp_reset': (.text+0x4cd58): undefined reference to `atomisp_mrfld_power_up' drivers/staging/built-in.o: In function `atomisp_reset': (.text+0x4cd77): undefined reference to `atomisp_runtime_resume' Removing the #ifdef around the PM functions avoids the problem, and lets us simplify it further. The __maybe_unused annotation is needed to ensure the compiler can silently drop the unused callbacks. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Arnd Bergmann --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c index 9bd186bad1bd..9b4508e731f3 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c @@ -310,7 +310,6 @@ static int __maybe_unused atomisp_restore_iunit_reg(struct atomisp_device *isp) return 0; } -#ifdef CONFIG_PM static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) { struct pci_dev *dev = isp->pdev; @@ -550,7 +549,7 @@ int atomisp_runtime_resume(struct device *dev) return 0; } -static int atomisp_suspend(struct device *dev) +static int __maybe_unused atomisp_suspend(struct device *dev) { struct atomisp_device *isp = (struct atomisp_device *) dev_get_drvdata(dev); @@ -588,7 +587,7 @@ static int atomisp_suspend(struct device *dev) return atomisp_mrfld_power_down(isp); } -static int atomisp_resume(struct device *dev) +static int __maybe_unused atomisp_resume(struct device *dev) { struct atomisp_device *isp = (struct atomisp_device *) dev_get_drvdata(dev); @@ -614,7 +613,6 @@ static int atomisp_resume(struct device *dev) atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_LOW, true); return 0; } -#endif int atomisp_csi_lane_config(struct atomisp_device *isp) { @@ -1576,7 +1574,6 @@ static const struct pci_device_id atomisp_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, atomisp_pci_tbl); -#ifdef CONFIG_PM static const struct dev_pm_ops atomisp_pm_ops = { .runtime_suspend = atomisp_runtime_suspend, .runtime_resume = atomisp_runtime_resume, @@ -1584,14 +1581,9 @@ static const struct dev_pm_ops atomisp_pm_ops = { .resume = atomisp_resume, }; -#define DEV_PM_OPS (&atomisp_pm_ops) -#else -#define DEV_PM_OPS NULL -#endif - static struct pci_driver atomisp_pci_driver = { .driver = { - .pm = DEV_PM_OPS, + .pm = &atomisp_pm_ops, }, .name = "atomisp-isp2", .id_table = atomisp_pci_tbl,