From patchwork Wed Mar 2 15:59:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8483251 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 12057C0553 for ; Wed, 2 Mar 2016 16:05:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29BA72037C for ; Wed, 2 Mar 2016 16:05:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4DDBA20351 for ; Wed, 2 Mar 2016 16:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756494AbcCBQE2 (ORCPT ); Wed, 2 Mar 2016 11:04:28 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:62982 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756347AbcCBQAq (ORCPT ); Wed, 2 Mar 2016 11:00:46 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0Lsw94-1Zv1xi1Yl8-012cCJ; Wed, 02 Mar 2016 17:00:40 +0100 From: Arnd Bergmann To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/14] [media] omap3isp: use IS_ENABLED() to hide pm functions Date: Wed, 2 Mar 2016 16:59:05 +0100 Message-Id: <1456934350-1389172-14-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456934350-1389172-1-git-send-email-arnd@arndb.de> References: <1456934350-1389172-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:fWaIY3IYoq1zj7EM1WmCExFOjpV99OMcIx/S13lIIO0+m6u4SFM q2TF1C17fhFRUIM4LgEv4Fp3qCE/oeCzK7nSb0W7pW2+cS++cmyYMwZEKTD7tA1SSfCMvLP KgStj8phPj+5lvjw6dCch5u8wf3UyKHWrjZnWZN89qB/7pvfmdv3RySxKc4UXHhKE+7nQXn KtUb7fOm5VNZSzRnvmVyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:c0M1v7BH9Zg=:PDmcsHgbus/0c8z2k7+pxa 8ME/8E1z+yO78DBBoTz3SUpwFCW2VtoDxgnFAM7NzrBLtIL+buSWpoPOwBl9tZz1zHJsQ1OhI XtyYR3qiTkh4leSYZHbo/08j0cQ6nCkgCyp568S+JInwTVvp4zBeohK2Tijr7raM0fE0yGlAa tQL/rnrUTJp4Vu7S43DJyA8NlhkspBEYCvsQIwgDPTx/T1rJnsF+lPO03bknrDoQDA2rVwY0S KyHJZvhMo1O4o/tPkwbqADMXe0FBPO0AePvEsjB1b0Ahv+VR34dsl4FuYU/uvK9khsRKSgvzM 5Pe70a7XtANhQEp66njTJOsQT87BZjOKHelfcukn4ArtR1WmRvE2FvuwkB0qzgMeVQpGJPez5 +IDj92GDVIkIQzL0abxCwpcxBoEE1VEL02bHwsKGu7wpJ9IINXBqaxtVOMiJiZvi6peS+mzhB fBKtoOtPHnS/Id90GKPR1fLERKMg36i3i1ZKxgRISIMyyNo62+PQdrchvVlCDoiszi7jjVA42 skVFJoeDZP3HjTjR+/owNH5EaiTx9NGXk31xwoqfjSVPSPLFkgzSHEUbV1ylxkqQcaDzs9Eda srRb7965WIKoAqphGqLCTbJVR6dQrxeCx88NUo1of2SaZkOVHRJ9vuf+71Qwm1bsRuOhLuZdA vaWiDpugVqAViKQH86bbIAilmiwJf+i7PbwaFZ0/D+GgZ4nq6iEaE5dUcwjehTPXiMPU= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The omap3isp driver hides is power management functions using #ifdef but it fails to hide the isp_suspend_modules/isp_resume_modules functions in the same way, which leads to a build warning when CONFIG_PM is disabled: drivers/media/platform/omap3isp/isp.c:1183:12: error: 'isp_suspend_modules' defined but not used [-Werror=unused-function] drivers/media/platform/omap3isp/isp.c:1217:13: error: 'isp_resume_modules' defined but not used [-Werror=unused-function] As the driver manually defines its dev_pm_ops structure and all members are NULL without CONFIG_PM, we can simply avoid referencing the structure using an IS_ENABLED() check, and drop all the #ifdef to avoid all warnings. Signed-off-by: Arnd Bergmann --- drivers/media/platform/omap3isp/isp.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index f9e5245f26ac..7f118baca270 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -1713,8 +1713,6 @@ void omap3isp_print_status(struct isp_device *isp) dev_dbg(isp->dev, "--------------------------------------------\n"); } -#ifdef CONFIG_PM - /* * Power management support. * @@ -1785,15 +1783,6 @@ static void isp_pm_complete(struct device *dev) isp_resume_modules(isp); } -#else - -#define isp_pm_prepare NULL -#define isp_pm_suspend NULL -#define isp_pm_resume NULL -#define isp_pm_complete NULL - -#endif /* CONFIG_PM */ - static void isp_unregister_entities(struct isp_device *isp) { omap3isp_csi2_unregister_entities(&isp->isp_csi2a); @@ -2611,7 +2600,7 @@ static struct platform_driver omap3isp_driver = { .id_table = omap3isp_id_table, .driver = { .name = "omap3isp", - .pm = &omap3isp_pm_ops, + .pm = IS_ENABLED(CONFIG_PM) ? &omap3isp_pm_ops : NULL, .of_match_table = omap3isp_of_table, }, };