Commit ec6516bf authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Walleij

pinctrl: remove unneeded #ifdef around declarations

What is the point in surrounding the whole of declarations with
ifdef like this?

  #ifdef CONFIG_FOO
  int foo(void);
  #endif

If CONFIG_FOO is not defined, all callers of foo() will fail
with implicit declaration errors since the top Makefile adds
-Werror-implicit-function-declaration to KBUILD_CFLAGS.

This breaks the build earlier when you are doing something wrong.
That's it.

Anyway, it will fail to link since the definition of foo() is not
compiled.

In summary, these ifdef are unneeded.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d9c238c5
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
#ifndef __LINUX_PINCTRL_PINCONF_GENERIC_H #ifndef __LINUX_PINCTRL_PINCONF_GENERIC_H
#define __LINUX_PINCTRL_PINCONF_GENERIC_H #define __LINUX_PINCTRL_PINCONF_GENERIC_H
#include <linux/device.h>
#include <linux/pinctrl/machine.h>
struct pinctrl_dev;
struct pinctrl_map;
/** /**
* enum pin_config_param - possible pin configuration parameters * enum pin_config_param - possible pin configuration parameters
* @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
...@@ -159,9 +165,6 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param ...@@ -159,9 +165,6 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param
return PIN_CONF_PACKED(param, argument); return PIN_CONF_PACKED(param, argument);
} }
#ifdef CONFIG_GENERIC_PINCONF
#ifdef CONFIG_DEBUG_FS
#define PCONFDUMP(a, b, c, d) { \ #define PCONFDUMP(a, b, c, d) { \
.param = a, .display = b, .format = c, .has_arg = d \ .param = a, .display = b, .format = c, .has_arg = d \
} }
...@@ -172,14 +175,6 @@ struct pin_config_item { ...@@ -172,14 +175,6 @@ struct pin_config_item {
const char * const format; const char * const format;
bool has_arg; bool has_arg;
}; };
#endif /* CONFIG_DEBUG_FS */
#ifdef CONFIG_OF
#include <linux/device.h>
#include <linux/pinctrl/machine.h>
struct pinctrl_dev;
struct pinctrl_map;
struct pinconf_generic_params { struct pinconf_generic_params {
const char * const property; const char * const property;
...@@ -224,8 +219,5 @@ static inline int pinconf_generic_dt_node_to_map_all( ...@@ -224,8 +219,5 @@ static inline int pinconf_generic_dt_node_to_map_all(
return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
PIN_MAP_TYPE_INVALID); PIN_MAP_TYPE_INVALID);
} }
#endif
#endif /* CONFIG_GENERIC_PINCONF */
#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */ #endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#ifndef __LINUX_PINCTRL_PINCONF_H #ifndef __LINUX_PINCTRL_PINCONF_H
#define __LINUX_PINCTRL_PINCONF_H #define __LINUX_PINCTRL_PINCONF_H
#ifdef CONFIG_PINCONF
#include <linux/types.h> #include <linux/types.h>
struct pinctrl_dev; struct pinctrl_dev;
...@@ -67,6 +65,4 @@ struct pinconf_ops { ...@@ -67,6 +65,4 @@ struct pinconf_ops {
unsigned long config); unsigned long config);
}; };
#endif
#endif /* __LINUX_PINCTRL_PINCONF_H */ #endif /* __LINUX_PINCTRL_PINCONF_H */
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#ifndef __LINUX_PINCTRL_PINCTRL_H #ifndef __LINUX_PINCTRL_PINCTRL_H
#define __LINUX_PINCTRL_PINCTRL_H #define __LINUX_PINCTRL_PINCTRL_H
#ifdef CONFIG_PINCTRL
#include <linux/radix-tree.h> #include <linux/radix-tree.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
...@@ -203,6 +201,4 @@ extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); ...@@ -203,6 +201,4 @@ extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
#endif /* !CONFIG_PINCTRL */
#endif /* __LINUX_PINCTRL_PINCTRL_H */ #endif /* __LINUX_PINCTRL_PINCTRL_H */
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/pinctrl/pinctrl.h> #include <linux/pinctrl/pinctrl.h>
#ifdef CONFIG_PINMUX
struct pinctrl_dev; struct pinctrl_dev;
/** /**
...@@ -85,6 +83,4 @@ struct pinmux_ops { ...@@ -85,6 +83,4 @@ struct pinmux_ops {
bool strict; bool strict;
}; };
#endif /* CONFIG_PINMUX */
#endif /* __LINUX_PINCTRL_PINMUX_H */ #endif /* __LINUX_PINCTRL_PINMUX_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment