From patchwork Wed Jan 28 16:08:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5731791 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D7D389F1C4 for ; Wed, 28 Jan 2015 21:52:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13C07201F2 for ; Wed, 28 Jan 2015 21:52:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27AEC20108 for ; Wed, 28 Jan 2015 21:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757798AbbA1Vwi (ORCPT ); Wed, 28 Jan 2015 16:52:38 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:62129 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252AbbA1UbD (ORCPT ); Wed, 28 Jan 2015 15:31:03 -0500 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0LwEHK-1Xcbs81P6k-0185XN; Wed, 28 Jan 2015 17:08:46 +0100 From: Arnd Bergmann To: linus.walleij@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org, Michal Simek Subject: [PATCH] pinctrl: hide PCONFDUMP in #ifdef Date: Wed, 28 Jan 2015 17:08:44 +0100 Message-ID: <4217929.mzU2TuSLSj@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:ZvFB/4CPTEEppXbRCng0UV4Q/HXSZpBJJhkx/e4xxFSuIdqib5Q C8ttVmlG+m1YoVRcPBgVGhl2PHHoz0U8QhQBHJOdSEOpPz2nnAv/iPT5qbp2ABWRb08IrqX E+R+wUHlwCvZOS7qBIaZqwscM4shH5/I/kEkS7Pc00CY2NnFlvSdX1j1Yk3nYZdxAC+fGQZ Ht3JVj8ozCrYCzKVDo37g== X-UI-Out-Filterresults: notjunk:1; Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, SUSPICIOUS_RECIPS, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 zynq and qcom-spmi pinctrl drivers both use pin_config_item arrays to provide extra interfaces in debugfs. This structure and the PCONFDUMP macro are not defined if CONFIG_DEBUG_FS is turned off, so we get build errors like: pinctrl/qcom/pinctrl-spmi-gpio.c:139:37: error: array type has incomplete element type static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = { ^ pinctrl/qcom/pinctrl-spmi-gpio.c:140:2: error: implicit declaration of function 'PCONFDUMP' [-Werror=implicit-function-declaration] PCONFDUMP(PMIC_GPIO_CONF_PULL_UP, "pull up strength", NULL, true), ^ pinctrl/qcom/pinctrl-spmi-gpio.c:139:37: warning: 'pmic_conf_items' defined but not used [-Wunused-variable] static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = { Lacking any better idea to solve this nicely, this patch uses #ifdef to hide the structures, just like the pinctrl core does. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c index 8aa05e2eb705..36252df3c737 100644 --- a/drivers/pinctrl/pinctrl-zynq.c +++ b/drivers/pinctrl/pinctrl-zynq.c @@ -924,9 +924,11 @@ static const struct pinconf_generic_params zynq_dt_params[] = { {"io-standard", PIN_CONFIG_IOSTANDARD, zynq_iostd_lvcmos18}, }; +#ifdef CONFIG_DEBUG_FS static const struct pin_config_item zynq_conf_items[ARRAY_SIZE(zynq_dt_params)] = { PCONFDUMP(PIN_CONFIG_IOSTANDARD, "IO-standard", NULL, true), }; +#endif static unsigned int zynq_pinconf_iostd_get(u32 reg) { @@ -1101,7 +1103,9 @@ static struct pinctrl_desc zynq_desc = { .confops = &zynq_pinconf_ops, .num_custom_params = ARRAY_SIZE(zynq_dt_params), .custom_params = zynq_dt_params, +#ifdef CONFIG_DEBUG_FS .custom_conf_items = zynq_conf_items, +#endif .owner = THIS_MODULE, }; diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index bbf99a715b63..0f11a26d932b 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -136,10 +136,12 @@ static const struct pinconf_generic_params pmic_gpio_bindings[] = { {"qcom,drive-strength", PMIC_GPIO_CONF_STRENGTH, 0}, }; +#ifdef CONFIG_DEBUG_FS static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = { PCONFDUMP(PMIC_GPIO_CONF_PULL_UP, "pull up strength", NULL, true), PCONFDUMP(PMIC_GPIO_CONF_STRENGTH, "drive-strength", NULL, true), }; +#endif static const char *const pmic_gpio_groups[] = { "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", @@ -744,7 +746,9 @@ static int pmic_gpio_probe(struct platform_device *pdev) pctrldesc->npins = npins; pctrldesc->num_custom_params = ARRAY_SIZE(pmic_gpio_bindings); pctrldesc->custom_params = pmic_gpio_bindings; +#ifdef CONFIG_DEBUG_FS pctrldesc->custom_conf_items = pmic_conf_items; +#endif for (i = 0; i < npins; i++, pindesc++) { pad = &pads[i];