From patchwork Fri Apr 28 12:10:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 41057 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d44jS-0002uW-2e; Fri, 28 Apr 2017 12:10:42 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-5) with esmtp id 1d44jP-0006Ki-8a; Fri, 28 Apr 2017 14:10:41 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425814AbdD1MKh (ORCPT + 1 other); Fri, 28 Apr 2017 08:10:37 -0400 Received: from mga02.intel.com ([134.134.136.20]:38879 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425804AbdD1MKe (ORCPT ); Fri, 28 Apr 2017 08:10:34 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 05:10:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,388,1488873600"; d="scan'208";a="93282732" Received: from acox1-desk1.ger.corp.intel.com ([10.252.17.169]) by orsmga005.jf.intel.com with ESMTP; 28 Apr 2017 05:10:32 -0700 Subject: [PATCH 7/8] staging: atomisp: remove #ifdef for runtime PM functions From: Alan Cox To: greg@kroah.com, linux-media@vger.kernel.org Date: Fri, 28 Apr 2017 13:10:31 +0100 Message-ID: <149338142997.2556.11440015221647658745.stgit@acox1-desk1.ger.corp.intel.com> In-Reply-To: <149338135275.2556.7708531564733886566.stgit@acox1-desk1.ger.corp.intel.com> References: <149338135275.2556.7708531564733886566.stgit@acox1-desk1.ger.corp.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.4.28.120316 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_URI_HTTPS 0, REFERENCES 0, __ANY_URI 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' From: Arnd Bergmann 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 Signed-off-by: Alan Cox --- .../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 35414c9..e3fdbdb 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,