diff options
| author | Rob Herring <rob.herring@calxeda.com> | 2013-09-04 11:52:57 -0400 |
|---|---|---|
| committer | Rob Herring <rob.herring@calxeda.com> | 2013-09-24 22:12:32 -0400 |
| commit | b0b8c960ffcc5bfc82d1a09ad931673e3a36c15a (patch) | |
| tree | 671a9150e3949d3d4ee7b1e31aaf473f865bbf3b /include | |
| parent | ede2033c405bfbd6b74b113cf69c6f54cef35902 (diff) | |
of: clean-up ifdefs in of_irq.h
Much of of_irq.h is needlessly ifdef'ed. Clean this up and minimize the
amount ifdef'ed code. This fixes some build warnings when CONFIG_OF
is not enabled (seen on i386 and x86_64):
include/linux/of_irq.h:82:7: warning: 'struct device_node' declared inside parameter list [enabled by default]
include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
include/linux/of_irq.h:87:47: warning: 'struct device_node' declared inside parameter list [enabled by default]
Compile tested on i386, sparc and arm.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/of_irq.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 535cecf1e02f..fcd63baee5f2 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | #ifndef __OF_IRQ_H | 1 | #ifndef __OF_IRQ_H |
| 2 | #define __OF_IRQ_H | 2 | #define __OF_IRQ_H |
| 3 | 3 | ||
| 4 | #if defined(CONFIG_OF) | ||
| 5 | struct of_irq; | ||
| 6 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 7 | #include <linux/errno.h> | 5 | #include <linux/errno.h> |
| 8 | #include <linux/irq.h> | 6 | #include <linux/irq.h> |
| @@ -10,14 +8,6 @@ struct of_irq; | |||
| 10 | #include <linux/ioport.h> | 8 | #include <linux/ioport.h> |
| 11 | #include <linux/of.h> | 9 | #include <linux/of.h> |
| 12 | 10 | ||
| 13 | /* | ||
| 14 | * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC | ||
| 15 | * implements it differently. However, the prototype is the same for all, | ||
| 16 | * so declare it here regardless of the CONFIG_OF_IRQ setting. | ||
| 17 | */ | ||
| 18 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); | ||
| 19 | |||
| 20 | #if defined(CONFIG_OF_IRQ) | ||
| 21 | /** | 11 | /** |
| 22 | * of_irq - container for device_node/irq_specifier pair for an irq controller | 12 | * of_irq - container for device_node/irq_specifier pair for an irq controller |
| 23 | * @controller: pointer to interrupt controller device tree node | 13 | * @controller: pointer to interrupt controller device tree node |
| @@ -71,11 +61,17 @@ extern int of_irq_to_resource(struct device_node *dev, int index, | |||
| 71 | extern int of_irq_count(struct device_node *dev); | 61 | extern int of_irq_count(struct device_node *dev); |
| 72 | extern int of_irq_to_resource_table(struct device_node *dev, | 62 | extern int of_irq_to_resource_table(struct device_node *dev, |
| 73 | struct resource *res, int nr_irqs); | 63 | struct resource *res, int nr_irqs); |
| 74 | extern struct device_node *of_irq_find_parent(struct device_node *child); | ||
| 75 | 64 | ||
| 76 | extern void of_irq_init(const struct of_device_id *matches); | 65 | extern void of_irq_init(const struct of_device_id *matches); |
| 77 | 66 | ||
| 78 | #endif /* CONFIG_OF_IRQ */ | 67 | #if defined(CONFIG_OF) |
| 68 | /* | ||
| 69 | * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC | ||
| 70 | * implements it differently. However, the prototype is the same for all, | ||
| 71 | * so declare it here regardless of the CONFIG_OF_IRQ setting. | ||
| 72 | */ | ||
| 73 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); | ||
| 74 | extern struct device_node *of_irq_find_parent(struct device_node *child); | ||
| 79 | 75 | ||
| 80 | #else /* !CONFIG_OF */ | 76 | #else /* !CONFIG_OF */ |
| 81 | static inline unsigned int irq_of_parse_and_map(struct device_node *dev, | 77 | static inline unsigned int irq_of_parse_and_map(struct device_node *dev, |
