1 From 704f3796c741df558d624078c5094439c0b65d09 Mon Sep 17 00:00:00 2001
2 From: Rob Herring <rob.herring@calxeda.com>
3 Date: Thu, 19 Dec 2013 09:30:49 -0300
4 Subject: [PATCH 178/203] of: clean-up ifdefs in of_irq.h
6 Much of of_irq.h is needlessly ifdef'ed. Clean this up and minimize the
7 amount ifdef'ed code. This fixes some build warnings when CONFIG_OF
8 is not enabled (seen on i386 and x86_64):
10 include/linux/of_irq.h:82:7: warning: 'struct device_node' declared inside parameter list [enabled by default]
11 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]
12 include/linux/of_irq.h:87:47: warning: 'struct device_node' declared inside parameter list [enabled by default]
14 Compile tested on i386, sparc and arm.
16 Reported-by: Randy Dunlap <rdunlap@infradead.org>
17 Cc: Grant Likely <grant.likely@linaro.org>
18 Signed-off-by: Rob Herring <rob.herring@calxeda.com>
20 include/linux/of_irq.h | 20 ++++++++------------
21 1 file changed, 8 insertions(+), 12 deletions(-)
23 --- a/include/linux/of_irq.h
24 +++ b/include/linux/of_irq.h
29 -#if defined(CONFIG_OF)
31 #include <linux/types.h>
32 #include <linux/errno.h>
33 #include <linux/irq.h>
34 @@ -10,14 +8,6 @@ struct of_irq;
35 #include <linux/ioport.h>
39 - * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC
40 - * implements it differently. However, the prototype is the same for all,
41 - * so declare it here regardless of the CONFIG_OF_IRQ setting.
43 -extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
45 -#if defined(CONFIG_OF_IRQ)
47 * of_irq - container for device_node/irq_specifier pair for an irq controller
48 * @controller: pointer to interrupt controller device tree node
49 @@ -71,11 +61,17 @@ extern int of_irq_to_resource(struct dev
50 extern int of_irq_count(struct device_node *dev);
51 extern int of_irq_to_resource_table(struct device_node *dev,
52 struct resource *res, int nr_irqs);
53 -extern struct device_node *of_irq_find_parent(struct device_node *child);
55 extern void of_irq_init(const struct of_device_id *matches);
57 -#endif /* CONFIG_OF_IRQ */
58 +#if defined(CONFIG_OF)
60 + * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC
61 + * implements it differently. However, the prototype is the same for all,
62 + * so declare it here regardless of the CONFIG_OF_IRQ setting.
64 +extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
65 +extern struct device_node *of_irq_find_parent(struct device_node *child);
67 #else /* !CONFIG_OF */
68 static inline unsigned int irq_of_parse_and_map(struct device_node *dev,