aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/irq.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-09-19 12:22:36 -0400
committerGrant Likely <grant.likely@linaro.org>2013-10-24 06:40:59 -0400
commit0c02c8007ea5554d028f99fd3e29fc201fdeeab3 (patch)
treef9f42756d719023033549c4de5c30650f42a1ba9 /drivers/of/irq.c
parent4a43d686fe336cc0e955c4400ba4d3fcff788786 (diff)
of/irq: Rename of_irq_map_* functions to of_irq_parse_*
The OF irq handling code has been overloading the term 'map' to refer to both parsing the data in the device tree and mapping it to the internal linux irq system. This is probably because the device tree does have the concept of an 'interrupt-map' function for translating interrupt references from one node to another, but 'map' is still confusing when the primary purpose of some of the functions are to parse the DT data. This patch renames all the of_irq_map_* functions to of_irq_parse_* which makes it clear that there is a difference between the parsing phase and the mapping phase. Kernel code can make use of just the parsing or just the mapping support as needed by the subsystem. The patch was generated mechanically with a handful of sed commands. Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/of/irq.c')
-rw-r--r--drivers/of/irq.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 90068f914911..410aa2415f42 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -31,14 +31,14 @@
31 * @dev: Device node of the device whose interrupt is to be mapped 31 * @dev: Device node of the device whose interrupt is to be mapped
32 * @index: Index of the interrupt to map 32 * @index: Index of the interrupt to map
33 * 33 *
34 * This function is a wrapper that chains of_irq_map_one() and 34 * This function is a wrapper that chains of_irq_parse_one() and
35 * irq_create_of_mapping() to make things easier to callers 35 * irq_create_of_mapping() to make things easier to callers
36 */ 36 */
37unsigned int irq_of_parse_and_map(struct device_node *dev, int index) 37unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
38{ 38{
39 struct of_irq oirq; 39 struct of_irq oirq;
40 40
41 if (of_irq_map_one(dev, index, &oirq)) 41 if (of_irq_parse_one(dev, index, &oirq))
42 return 0; 42 return 0;
43 43
44 return irq_create_of_mapping(oirq.controller, oirq.specifier, 44 return irq_create_of_mapping(oirq.controller, oirq.specifier,
@@ -79,7 +79,7 @@ struct device_node *of_irq_find_parent(struct device_node *child)
79} 79}
80 80
81/** 81/**
82 * of_irq_map_raw - Low level interrupt tree parsing 82 * of_irq_parse_raw - Low level interrupt tree parsing
83 * @parent: the device interrupt parent 83 * @parent: the device interrupt parent
84 * @intspec: interrupt specifier ("interrupts" property of the device) 84 * @intspec: interrupt specifier ("interrupts" property of the device)
85 * @ointsize: size of the passed in interrupt specifier 85 * @ointsize: size of the passed in interrupt specifier
@@ -93,7 +93,7 @@ struct device_node *of_irq_find_parent(struct device_node *child)
93 * properties, for example when resolving PCI interrupts when no device 93 * properties, for example when resolving PCI interrupts when no device
94 * node exist for the parent. 94 * node exist for the parent.
95 */ 95 */
96int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, 96int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
97 u32 ointsize, const __be32 *addr, struct of_irq *out_irq) 97 u32 ointsize, const __be32 *addr, struct of_irq *out_irq)
98{ 98{
99 struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL; 99 struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
@@ -101,7 +101,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
101 u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0; 101 u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
102 int imaplen, match, i; 102 int imaplen, match, i;
103 103
104 pr_debug("of_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n", 104 pr_debug("of_irq_parse_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
105 of_node_full_name(parent), be32_to_cpup(intspec), 105 of_node_full_name(parent), be32_to_cpup(intspec),
106 be32_to_cpup(intspec + 1), ointsize); 106 be32_to_cpup(intspec + 1), ointsize);
107 107
@@ -126,7 +126,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
126 goto fail; 126 goto fail;
127 } 127 }
128 128
129 pr_debug("of_irq_map_raw: ipar=%s, size=%d\n", of_node_full_name(ipar), intsize); 129 pr_debug("of_irq_parse_raw: ipar=%s, size=%d\n", of_node_full_name(ipar), intsize);
130 130
131 if (ointsize != intsize) 131 if (ointsize != intsize)
132 return -EINVAL; 132 return -EINVAL;
@@ -269,29 +269,29 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
269 269
270 return -EINVAL; 270 return -EINVAL;
271} 271}
272EXPORT_SYMBOL_GPL(of_irq_map_raw); 272EXPORT_SYMBOL_GPL(of_irq_parse_raw);
273 273
274/** 274/**
275 * of_irq_map_one - Resolve an interrupt for a device 275 * of_irq_parse_one - Resolve an interrupt for a device
276 * @device: the device whose interrupt is to be resolved 276 * @device: the device whose interrupt is to be resolved
277 * @index: index of the interrupt to resolve 277 * @index: index of the interrupt to resolve
278 * @out_irq: structure of_irq filled by this function 278 * @out_irq: structure of_irq filled by this function
279 * 279 *
280 * This function resolves an interrupt, walking the tree, for a given 280 * This function resolves an interrupt, walking the tree, for a given
281 * device-tree node. It's the high level pendant to of_irq_map_raw(). 281 * device-tree node. It's the high level pendant to of_irq_parse_raw().
282 */ 282 */
283int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq) 283int of_irq_parse_one(struct device_node *device, int index, struct of_irq *out_irq)
284{ 284{
285 struct device_node *p; 285 struct device_node *p;
286 const __be32 *intspec, *tmp, *addr; 286 const __be32 *intspec, *tmp, *addr;
287 u32 intsize, intlen; 287 u32 intsize, intlen;
288 int res = -EINVAL; 288 int res = -EINVAL;
289 289
290 pr_debug("of_irq_map_one: dev=%s, index=%d\n", of_node_full_name(device), index); 290 pr_debug("of_irq_parse_one: dev=%s, index=%d\n", of_node_full_name(device), index);
291 291
292 /* OldWorld mac stuff is "special", handle out of line */ 292 /* OldWorld mac stuff is "special", handle out of line */
293 if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC) 293 if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
294 return of_irq_map_oldworld(device, index, out_irq); 294 return of_irq_parse_oldworld(device, index, out_irq);
295 295
296 /* Get the interrupts property */ 296 /* Get the interrupts property */
297 intspec = of_get_property(device, "interrupts", &intlen); 297 intspec = of_get_property(device, "interrupts", &intlen);
@@ -322,13 +322,13 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
322 goto out; 322 goto out;
323 323
324 /* Get new specifier and map it */ 324 /* Get new specifier and map it */
325 res = of_irq_map_raw(p, intspec + index * intsize, intsize, 325 res = of_irq_parse_raw(p, intspec + index * intsize, intsize,
326 addr, out_irq); 326 addr, out_irq);
327 out: 327 out:
328 of_node_put(p); 328 of_node_put(p);
329 return res; 329 return res;
330} 330}
331EXPORT_SYMBOL_GPL(of_irq_map_one); 331EXPORT_SYMBOL_GPL(of_irq_parse_one);
332 332
333/** 333/**
334 * of_irq_to_resource - Decode a node's IRQ and return it as a resource 334 * of_irq_to_resource - Decode a node's IRQ and return it as a resource