diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-01-28 11:08:44 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-30 08:30:59 -0500 |
commit | 4f06266a62446afc07c6b7e64edc55ea13852bce (patch) | |
tree | 248fd817602675831df40de7000b946671dfd20c | |
parent | 5ae0c7ad06f4386d253ff2120ea769f01292f37b (diff) |
pinctrl: hide PCONFDUMP in #ifdef
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 <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-zynq.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c index 6480ed533a87..22280bddb9e2 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[] = { | |||
924 | {"io-standard", PIN_CONFIG_IOSTANDARD, zynq_iostd_lvcmos18}, | 924 | {"io-standard", PIN_CONFIG_IOSTANDARD, zynq_iostd_lvcmos18}, |
925 | }; | 925 | }; |
926 | 926 | ||
927 | #ifdef CONFIG_DEBUG_FS | ||
927 | static const struct pin_config_item zynq_conf_items[ARRAY_SIZE(zynq_dt_params)] = { | 928 | static const struct pin_config_item zynq_conf_items[ARRAY_SIZE(zynq_dt_params)] = { |
928 | PCONFDUMP(PIN_CONFIG_IOSTANDARD, "IO-standard", NULL, true), | 929 | PCONFDUMP(PIN_CONFIG_IOSTANDARD, "IO-standard", NULL, true), |
929 | }; | 930 | }; |
931 | #endif | ||
930 | 932 | ||
931 | static unsigned int zynq_pinconf_iostd_get(u32 reg) | 933 | static unsigned int zynq_pinconf_iostd_get(u32 reg) |
932 | { | 934 | { |
@@ -1101,7 +1103,9 @@ static struct pinctrl_desc zynq_desc = { | |||
1101 | .confops = &zynq_pinconf_ops, | 1103 | .confops = &zynq_pinconf_ops, |
1102 | .num_custom_params = ARRAY_SIZE(zynq_dt_params), | 1104 | .num_custom_params = ARRAY_SIZE(zynq_dt_params), |
1103 | .custom_params = zynq_dt_params, | 1105 | .custom_params = zynq_dt_params, |
1106 | #ifdef CONFIG_DEBUG_FS | ||
1104 | .custom_conf_items = zynq_conf_items, | 1107 | .custom_conf_items = zynq_conf_items, |
1108 | #endif | ||
1105 | .owner = THIS_MODULE, | 1109 | .owner = THIS_MODULE, |
1106 | }; | 1110 | }; |
1107 | 1111 | ||
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[] = { | |||
136 | {"qcom,drive-strength", PMIC_GPIO_CONF_STRENGTH, 0}, | 136 | {"qcom,drive-strength", PMIC_GPIO_CONF_STRENGTH, 0}, |
137 | }; | 137 | }; |
138 | 138 | ||
139 | #ifdef CONFIG_DEBUG_FS | ||
139 | static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = { | 140 | static const struct pin_config_item pmic_conf_items[ARRAY_SIZE(pmic_gpio_bindings)] = { |
140 | PCONFDUMP(PMIC_GPIO_CONF_PULL_UP, "pull up strength", NULL, true), | 141 | PCONFDUMP(PMIC_GPIO_CONF_PULL_UP, "pull up strength", NULL, true), |
141 | PCONFDUMP(PMIC_GPIO_CONF_STRENGTH, "drive-strength", NULL, true), | 142 | PCONFDUMP(PMIC_GPIO_CONF_STRENGTH, "drive-strength", NULL, true), |
142 | }; | 143 | }; |
144 | #endif | ||
143 | 145 | ||
144 | static const char *const pmic_gpio_groups[] = { | 146 | static const char *const pmic_gpio_groups[] = { |
145 | "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", | 147 | "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", |
@@ -744,7 +746,9 @@ static int pmic_gpio_probe(struct platform_device *pdev) | |||
744 | pctrldesc->npins = npins; | 746 | pctrldesc->npins = npins; |
745 | pctrldesc->num_custom_params = ARRAY_SIZE(pmic_gpio_bindings); | 747 | pctrldesc->num_custom_params = ARRAY_SIZE(pmic_gpio_bindings); |
746 | pctrldesc->custom_params = pmic_gpio_bindings; | 748 | pctrldesc->custom_params = pmic_gpio_bindings; |
749 | #ifdef CONFIG_DEBUG_FS | ||
747 | pctrldesc->custom_conf_items = pmic_conf_items; | 750 | pctrldesc->custom_conf_items = pmic_conf_items; |
751 | #endif | ||
748 | 752 | ||
749 | for (i = 0; i < npins; i++, pindesc++) { | 753 | for (i = 0; i < npins; i++, pindesc++) { |
750 | pad = &pads[i]; | 754 | pad = &pads[i]; |