base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0185-of-irq-simplify-args-to-irq_create_of_mapping.patch
1 From 5e69ff59f7e51ddfde0b31587beb9e40ea1c85bc Mon Sep 17 00:00:00 2001
2 From: Grant Likely <grant.likely@linaro.org>
3 Date: Thu, 19 Dec 2013 09:30:56 -0300
4 Subject: [PATCH 185/203] of/irq: simplify args to irq_create_of_mapping
5
6 All the callers of irq_create_of_mapping() pass the contents of a struct
7 of_phandle_args structure to the function. Since all the callers already
8 have an of_phandle_args pointer, why not pass it directly to
9 irq_create_of_mapping()?
10
11 Signed-off-by: Grant Likely <grant.likely@linaro.org>
12 Acked-by: Michal Simek <monstr@monstr.eu>
13 Acked-by: Tony Lindgren <tony@atomide.com>
14 Cc: Thomas Gleixner <tglx@linutronix.de>
15 Cc: Russell King <linux@arm.linux.org.uk>
16 Cc: Ralf Baechle <ralf@linux-mips.org>
17 Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
18
19 Conflicts:
20         arch/mips/pci/pci-rt3883.c
21         kernel/irq/irqdomain.c
22 ---
23  arch/arm/mach-integrator/pci_v3.c              |  2 +-
24  arch/microblaze/pci/pci-common.c               |  2 +-
25  arch/mips/pci/fixup-lantiq.c                   |  2 +-
26  arch/powerpc/kernel/pci-common.c               |  2 +-
27  arch/powerpc/platforms/cell/celleb_scc_pciex.c |  2 +-
28  arch/powerpc/platforms/cell/celleb_scc_sio.c   |  2 +-
29  arch/powerpc/platforms/cell/spider-pic.c       |  7 ++-----
30  arch/powerpc/platforms/cell/spu_manage.c       |  3 +--
31  arch/powerpc/platforms/fsl_uli1575.c           |  2 +-
32  arch/powerpc/platforms/pseries/event_sources.c |  3 +--
33  arch/x86/kernel/devicetree.c                   |  2 +-
34  drivers/of/irq.c                               |  2 +-
35  drivers/pci/host/pci-mvebu.c                   |  2 +-
36  include/linux/of_irq.h                         |  4 +---
37  kernel/irq/irqdomain.c                         | 15 +++++++--------
38  15 files changed, 22 insertions(+), 30 deletions(-)
39
40 --- a/arch/arm/mach-integrator/pci_v3.c
41 +++ b/arch/arm/mach-integrator/pci_v3.c
42 @@ -694,7 +694,7 @@ static int __init pci_v3_map_irq_dt(cons
43                 return 0;
44         }
45  
46 -       return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
47 +       return irq_create_of_mapping(&oirq);
48  }
49  
50  static int __init pci_v3_dtprobe(struct platform_device *pdev,
51 --- a/arch/microblaze/pci/pci-common.c
52 +++ b/arch/microblaze/pci/pci-common.c
53 @@ -246,7 +246,7 @@ int pci_read_irq_line(struct pci_dev *pc
54                          oirq.args_count, oirq.args[0], oirq.args[1],
55                          of_node_full_name(oirq.np));
56  
57 -               virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
58 +               virq = irq_create_of_mapping(&oirq);
59         }
60         if (!virq) {
61                 pr_debug(" Failed to map !\n");
62 --- a/arch/mips/pci/fixup-lantiq.c
63 +++ b/arch/mips/pci/fixup-lantiq.c
64 @@ -33,7 +33,7 @@ int __init pcibios_map_irq(const struct
65                         slot, pin);
66                 return 0;
67         }
68 -       irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count);
69 +       irq = irq_create_of_mapping(&dev_irq);
70         dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq);
71         return irq;
72  }
73 --- a/arch/powerpc/kernel/pci-common.c
74 +++ b/arch/powerpc/kernel/pci-common.c
75 @@ -266,7 +266,7 @@ static int pci_read_irq_line(struct pci_
76                          oirq.args_count, oirq.args[0], oirq.args[1],
77                          of_node_full_name(oirq.np));
78  
79 -               virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
80 +               virq = irq_create_of_mapping(&oirq);
81         }
82         if(virq == NO_IRQ) {
83                 pr_debug(" Failed to map !\n");
84 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
85 +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
86 @@ -511,7 +511,7 @@ static __init int celleb_setup_pciex(str
87                 pr_err("PCIEXC:Failed to map irq\n");
88                 goto error;
89         }
90 -       virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
91 +       virq = irq_create_of_mapping(&oirq);
92         if (request_irq(virq, pciex_handle_internal_irq,
93                         0, "pciex", (void *)phb)) {
94                 pr_err("PCIEXC:Failed to request irq\n");
95 --- a/arch/powerpc/platforms/cell/celleb_scc_sio.c
96 +++ b/arch/powerpc/platforms/cell/celleb_scc_sio.c
97 @@ -66,7 +66,7 @@ static int __init txx9_serial_init(void)
98  #ifdef CONFIG_SERIAL_TXX9_CONSOLE
99                         req.membase = ioremap(req.mapbase, 0x24);
100  #endif
101 -                       req.irq = irq_create_of_mapping(irq.np, irq.args, irq.args_count);
102 +                       req.irq = irq_create_of_mapping(&irq);
103                         req.flags |= UPF_IOREMAP | UPF_BUGGY_UART
104                                 /*HAVE_CTS_LINE*/;
105                         req.uartclk = 83300000;
106 --- a/arch/powerpc/platforms/cell/spider-pic.c
107 +++ b/arch/powerpc/platforms/cell/spider-pic.c
108 @@ -236,11 +236,8 @@ static unsigned int __init spider_find_c
109          * tree in case the device-tree is ever fixed
110          */
111         struct of_phandle_args oirq;
112 -       if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) {
113 -               virq = irq_create_of_mapping(oirq.np, oirq.args,
114 -                                            oirq.args_count);
115 -               return virq;
116 -       }
117 +       if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0)
118 +               return irq_create_of_mapping(&oirq);
119  
120         /* Now do the horrible hacks */
121         tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
122 --- a/arch/powerpc/platforms/cell/spu_manage.c
123 +++ b/arch/powerpc/platforms/cell/spu_manage.c
124 @@ -190,8 +190,7 @@ static int __init spu_map_interrupts(str
125                 ret = -EINVAL;
126                 pr_debug("  irq %d no 0x%x on %s\n", i, oirq.args[0],
127                          oirq.np->full_name);
128 -               spu->irqs[i] = irq_create_of_mapping(oirq.np,
129 -                                       oirq.args, oirq.args_count);
130 +               spu->irqs[i] = irq_create_of_mapping(&oirq);
131                 if (spu->irqs[i] == NO_IRQ) {
132                         pr_debug("spu_new: failed to map it !\n");
133                         goto err;
134 --- a/arch/powerpc/platforms/fsl_uli1575.c
135 +++ b/arch/powerpc/platforms/fsl_uli1575.c
136 @@ -334,7 +334,7 @@ static void hpcd_final_uli5288(struct pc
137         laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8);
138         laddr[1] = laddr[2] = 0;
139         of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq);
140 -       dev->irq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
141 +       dev->irq = irq_create_of_mapping(&oirq);
142  }
143  
144  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, hpcd_quirk_uli1575);
145 --- a/arch/powerpc/platforms/pseries/event_sources.c
146 +++ b/arch/powerpc/platforms/pseries/event_sources.c
147 @@ -59,8 +59,7 @@ void request_event_sources_irqs(struct d
148                      index++) {
149                         if (count > 15)
150                                 break;
151 -                       virqs[count] = irq_create_of_mapping(oirq.np, oirq.args,
152 -                                                           oirq.args_count);
153 +                       virqs[count] = irq_create_of_mapping(&oirq);
154                         if (virqs[count] == NO_IRQ) {
155                                 pr_err("event-sources: Unable to allocate "
156                                        "interrupt number for %s\n",
157 --- a/arch/x86/kernel/devicetree.c
158 +++ b/arch/x86/kernel/devicetree.c
159 @@ -121,7 +121,7 @@ static int x86_of_pci_irq_enable(struct
160         if (ret)
161                 return ret;
162  
163 -       virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
164 +       virq = irq_create_of_mapping(&oirq);
165         if (virq == 0)
166                 return -EINVAL;
167         dev->irq = virq;
168 --- a/drivers/of/irq.c
169 +++ b/drivers/of/irq.c
170 @@ -41,7 +41,7 @@ unsigned int irq_of_parse_and_map(struct
171         if (of_irq_parse_one(dev, index, &oirq))
172                 return 0;
173  
174 -       return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
175 +       return irq_create_of_mapping(&oirq);
176  }
177  EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
178  
179 --- a/drivers/pci/host/pci-mvebu.c
180 +++ b/drivers/pci/host/pci-mvebu.c
181 @@ -656,7 +656,7 @@ static int __init mvebu_pcie_map_irq(con
182         if (ret)
183                 return ret;
184  
185 -       return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
186 +       return irq_create_of_mapping(&oirq);
187  }
188  
189  static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys)
190 --- a/include/linux/of_irq.h
191 +++ b/include/linux/of_irq.h
192 @@ -37,9 +37,7 @@ extern int of_irq_parse_raw(struct devic
193                           struct of_phandle_args *out_irq);
194  extern int of_irq_parse_one(struct device_node *device, int index,
195                           struct of_phandle_args *out_irq);
196 -extern unsigned int irq_create_of_mapping(struct device_node *controller,
197 -                                         const u32 *intspec,
198 -                                         unsigned int intsize);
199 +extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data);
200  extern int of_irq_to_resource(struct device_node *dev, int index,
201                               struct resource *r);
202  extern int of_irq_count(struct device_node *dev);
203 --- a/kernel/irq/irqdomain.c
204 +++ b/kernel/irq/irqdomain.c
205 @@ -655,15 +655,14 @@ int irq_create_strict_mappings(struct ir
206  }
207  EXPORT_SYMBOL_GPL(irq_create_strict_mappings);
208  
209 -unsigned int irq_create_of_mapping(struct device_node *controller,
210 -                                  const u32 *intspec, unsigned int intsize)
211 +unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
212  {
213         struct irq_domain *domain;
214         irq_hw_number_t hwirq;
215         unsigned int type = IRQ_TYPE_NONE;
216         unsigned int virq;
217  
218 -       domain = controller ? irq_find_host(controller) : irq_default_domain;
219 +       domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain;
220         if (!domain) {
221  #ifdef CONFIG_MIPS
222                 /*
223 @@ -677,17 +676,17 @@ unsigned int irq_create_of_mapping(struc
224                 if (intsize > 0)
225                         return intspec[0];
226  #endif
227 -               pr_warning("no irq domain found for %s !\n",
228 -                          of_node_full_name(controller));
229 +               pr_warn("no irq domain found for %s !\n",
230 +                       of_node_full_name(irq_data->np));
231                 return 0;
232         }
233  
234         /* If domain has no translation, then we assume interrupt line */
235         if (domain->ops->xlate == NULL)
236 -               hwirq = intspec[0];
237 +               hwirq = irq_data->args[0];
238         else {
239 -               if (domain->ops->xlate(domain, controller, intspec, intsize,
240 -                                    &hwirq, &type))
241 +               if (domain->ops->xlate(domain, irq_data->np, irq_data->args,
242 +                                       irq_data->args_count, &hwirq, &type))
243                         return 0;
244         }
245