Skip to content

Commit 0c02c80

Browse files
committed
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 <[email protected]> Acked-by: Michal Simek <[email protected]> Acked-by: Tony Lindgren <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]>
1 parent 4a43d68 commit 0c02c80

File tree

20 files changed

+42
-42
lines changed

20 files changed

+42
-42
lines changed

arch/arm/mach-integrator/pci_v3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,9 @@ static int __init pci_v3_map_irq_dt(const struct pci_dev *dev, u8 slot, u8 pin)
840840
struct of_irq oirq;
841841
int ret;
842842

843-
ret = of_irq_map_pci(dev, &oirq);
843+
ret = of_irq_parse_pci(dev, &oirq);
844844
if (ret) {
845-
dev_err(&dev->dev, "of_irq_map_pci() %d\n", ret);
845+
dev_err(&dev->dev, "of_irq_parse_pci() %d\n", ret);
846846
/* Proper return code 0 == NO_IRQ */
847847
return 0;
848848
}

arch/microblaze/pci/pci-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
217217
memset(&oirq, 0xff, sizeof(oirq));
218218
#endif
219219
/* Try to get a mapping from the device-tree */
220-
if (of_irq_map_pci(pci_dev, &oirq)) {
220+
if (of_irq_parse_pci(pci_dev, &oirq)) {
221221
u8 line, pin;
222222

223223
/* If that fails, lets fallback to what is in the config

arch/mips/pci/fixup-lantiq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
2828
struct of_irq dev_irq;
2929
int irq;
3030

31-
if (of_irq_map_pci(dev, &dev_irq)) {
31+
if (of_irq_parse_pci(dev, &dev_irq)) {
3232
dev_err(&dev->dev, "trying to map irq for unknown slot:%d pin:%d\n",
3333
slot, pin);
3434
return 0;

arch/mips/pci/pci-rt3883.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
587587
int err;
588588
int irq;
589589

590-
err = of_irq_map_pci(dev, &dev_irq);
590+
err = of_irq_parse_pci(dev, &dev_irq);
591591
if (err) {
592592
pr_err("pci %s: unable to get irq map, err=%d\n",
593593
pci_name((struct pci_dev *) dev), err);

arch/powerpc/kernel/pci-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
237237
memset(&oirq, 0xff, sizeof(oirq));
238238
#endif
239239
/* Try to get a mapping from the device-tree */
240-
if (of_irq_map_pci(pci_dev, &oirq)) {
240+
if (of_irq_parse_pci(pci_dev, &oirq)) {
241241
u8 line, pin;
242242

243243
/* If that fails, lets fallback to what is in the config

arch/powerpc/platforms/cell/celleb_scc_pciex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static __init int celleb_setup_pciex(struct device_node *node,
507507
phb->ops = &scc_pciex_pci_ops;
508508

509509
/* internal interrupt handler */
510-
if (of_irq_map_one(node, 1, &oirq)) {
510+
if (of_irq_parse_one(node, 1, &oirq)) {
511511
pr_err("PCIEXC:Failed to map irq\n");
512512
goto error;
513513
}

arch/powerpc/platforms/cell/celleb_scc_sio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int __init txx9_serial_init(void)
5353
if (!(txx9_serial_bitmap & (1<<i)))
5454
continue;
5555

56-
if (of_irq_map_one(node, i, &irq))
56+
if (of_irq_parse_one(node, i, &irq))
5757
continue;
5858
if (of_address_to_resource(node,
5959
txx9_scc_tab[i].index, &res))

arch/powerpc/platforms/cell/spider-pic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
236236
* tree in case the device-tree is ever fixed
237237
*/
238238
struct of_irq oirq;
239-
if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) {
239+
if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) {
240240
virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
241241
oirq.size);
242242
return virq;

arch/powerpc/platforms/cell/spu_manage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
182182
int i;
183183

184184
for (i=0; i < 3; i++) {
185-
ret = of_irq_map_one(np, i, &oirq);
185+
ret = of_irq_parse_one(np, i, &oirq);
186186
if (ret) {
187187
pr_debug("spu_new: failed to get irq %d\n", i);
188188
goto err;

arch/powerpc/platforms/fsl_uli1575.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static void hpcd_final_uli5288(struct pci_dev *dev)
333333

334334
laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8);
335335
laddr[1] = laddr[2] = 0;
336-
of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
336+
of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq);
337337
virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
338338
oirq.size);
339339
dev->irq = virq;

arch/powerpc/platforms/powermac/pic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static void __init pmac_pic_probe_oldstyle(void)
393393
#endif
394394
}
395395

396-
int of_irq_map_oldworld(struct device_node *device, int index,
396+
int of_irq_parse_oldworld(struct device_node *device, int index,
397397
struct of_irq *out_irq)
398398
{
399399
const u32 *ints = NULL;

arch/powerpc/platforms/pseries/event_sources.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void request_event_sources_irqs(struct device_node *np,
5555
/* Else use normal interrupt tree parsing */
5656
else {
5757
/* First try to do a proper OF tree parsing */
58-
for (index = 0; of_irq_map_one(np, index, &oirq) == 0;
58+
for (index = 0; of_irq_parse_one(np, index, &oirq) == 0;
5959
index++) {
6060
if (count > 15)
6161
break;

arch/powerpc/sysdev/mpic_msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic)
6363
pr_debug("mpic: mapping hwirqs for %s\n", np->full_name);
6464

6565
index = 0;
66-
while (of_irq_map_one(np, index++, &oirq) == 0) {
66+
while (of_irq_parse_one(np, index++, &oirq) == 0) {
6767
ops->xlate(mpic->irqhost, NULL, oirq.specifier,
6868
oirq.size, &hwirq, &flags);
6969
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, hwirq);

arch/x86/kernel/devicetree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev)
116116
if (!pin)
117117
return 0;
118118

119-
ret = of_irq_map_pci(dev, &oirq);
119+
ret = of_irq_parse_pci(dev, &oirq);
120120
if (ret)
121121
return ret;
122122

drivers/of/address.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,12 @@ static u64 __of_translate_address(struct device_node *dev,
532532
pbus->count_cells(dev, &pna, &pns);
533533
if (!OF_CHECK_COUNTS(pna, pns)) {
534534
printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
535-
dev->full_name);
535+
of_node_full_name(dev));
536536
break;
537537
}
538538

539539
pr_debug("OF: parent bus is %s (na=%d, ns=%d) on %s\n",
540-
pbus->name, pna, pns, parent->full_name);
540+
pbus->name, pna, pns, of_node_full_name(parent));
541541

542542
/* Apply bus translation */
543543
if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))

drivers/of/irq.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
* @dev: Device node of the device whose interrupt is to be mapped
3232
* @index: Index of the interrupt to map
3333
*
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
3535
* irq_create_of_mapping() to make things easier to callers
3636
*/
3737
unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
3838
{
3939
struct of_irq oirq;
4040

41-
if (of_irq_map_one(dev, index, &oirq))
41+
if (of_irq_parse_one(dev, index, &oirq))
4242
return 0;
4343

4444
return irq_create_of_mapping(oirq.controller, oirq.specifier,
@@ -79,7 +79,7 @@ struct device_node *of_irq_find_parent(struct device_node *child)
7979
}
8080

8181
/**
82-
* of_irq_map_raw - Low level interrupt tree parsing
82+
* of_irq_parse_raw - Low level interrupt tree parsing
8383
* @parent: the device interrupt parent
8484
* @intspec: interrupt specifier ("interrupts" property of the device)
8585
* @ointsize: size of the passed in interrupt specifier
@@ -93,15 +93,15 @@ struct device_node *of_irq_find_parent(struct device_node *child)
9393
* properties, for example when resolving PCI interrupts when no device
9494
* node exist for the parent.
9595
*/
96-
int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
96+
int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
9797
u32 ointsize, const __be32 *addr, struct of_irq *out_irq)
9898
{
9999
struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
100100
const __be32 *tmp, *imap, *imask;
101101
u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
102102
int imaplen, match, i;
103103

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",
105105
of_node_full_name(parent), be32_to_cpup(intspec),
106106
be32_to_cpup(intspec + 1), ointsize);
107107

@@ -126,7 +126,7 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
126126
goto fail;
127127
}
128128

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);
130130

131131
if (ointsize != intsize)
132132
return -EINVAL;
@@ -269,29 +269,29 @@ int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
269269

270270
return -EINVAL;
271271
}
272-
EXPORT_SYMBOL_GPL(of_irq_map_raw);
272+
EXPORT_SYMBOL_GPL(of_irq_parse_raw);
273273

274274
/**
275-
* of_irq_map_one - Resolve an interrupt for a device
275+
* of_irq_parse_one - Resolve an interrupt for a device
276276
* @device: the device whose interrupt is to be resolved
277277
* @index: index of the interrupt to resolve
278278
* @out_irq: structure of_irq filled by this function
279279
*
280280
* 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().
282282
*/
283-
int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
283+
int of_irq_parse_one(struct device_node *device, int index, struct of_irq *out_irq)
284284
{
285285
struct device_node *p;
286286
const __be32 *intspec, *tmp, *addr;
287287
u32 intsize, intlen;
288288
int res = -EINVAL;
289289

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);
291291

292292
/* OldWorld mac stuff is "special", handle out of line */
293293
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);
295295

296296
/* Get the interrupts property */
297297
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
322322
goto out;
323323

324324
/* 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,
326326
addr, out_irq);
327327
out:
328328
of_node_put(p);
329329
return res;
330330
}
331-
EXPORT_SYMBOL_GPL(of_irq_map_one);
331+
EXPORT_SYMBOL_GPL(of_irq_parse_one);
332332

333333
/**
334334
* of_irq_to_resource - Decode a node's IRQ and return it as a resource

drivers/of/of_pci_irq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <asm/prom.h>
66

77
/**
8-
* of_irq_map_pci - Resolve the interrupt for a PCI device
8+
* of_irq_parse_pci - Resolve the interrupt for a PCI device
99
* @pdev: the device whose interrupt is to be resolved
1010
* @out_irq: structure of_irq filled by this function
1111
*
@@ -15,7 +15,7 @@
1515
* PCI tree until an device-node is found, at which point it will finish
1616
* resolving using the OF tree walking.
1717
*/
18-
int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq)
18+
int of_irq_parse_pci(const struct pci_dev *pdev, struct of_irq *out_irq)
1919
{
2020
struct device_node *dn, *ppnode;
2121
struct pci_dev *ppdev;
@@ -30,7 +30,7 @@ int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq)
3030
*/
3131
dn = pci_device_to_OF_node(pdev);
3232
if (dn) {
33-
rc = of_irq_map_one(dn, 0, out_irq);
33+
rc = of_irq_parse_one(dn, 0, out_irq);
3434
if (!rc)
3535
return rc;
3636
}
@@ -88,6 +88,6 @@ int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq)
8888
lspec_be = cpu_to_be32(lspec);
8989
laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8));
9090
laddr[1] = laddr[2] = cpu_to_be32(0);
91-
return of_irq_map_raw(ppnode, &lspec_be, 1, laddr, out_irq);
91+
return of_irq_parse_raw(ppnode, &lspec_be, 1, laddr, out_irq);
9292
}
93-
EXPORT_SYMBOL_GPL(of_irq_map_pci);
93+
EXPORT_SYMBOL_GPL(of_irq_parse_pci);

drivers/pci/host/pci-mvebu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static int __init mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
650650
struct of_irq oirq;
651651
int ret;
652652

653-
ret = of_irq_map_pci(dev, &oirq);
653+
ret = of_irq_parse_pci(dev, &oirq);
654654
if (ret)
655655
return ret;
656656

include/linux/of_irq.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
3535
#if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC)
3636
extern unsigned int of_irq_workarounds;
3737
extern struct device_node *of_irq_dflt_pic;
38-
extern int of_irq_map_oldworld(struct device_node *device, int index,
38+
extern int of_irq_parse_oldworld(struct device_node *device, int index,
3939
struct of_irq *out_irq);
4040
#else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
4141
#define of_irq_workarounds (0)
4242
#define of_irq_dflt_pic (NULL)
43-
static inline int of_irq_map_oldworld(struct device_node *device, int index,
43+
static inline int of_irq_parse_oldworld(struct device_node *device, int index,
4444
struct of_irq *out_irq)
4545
{
4646
return -EINVAL;
4747
}
4848
#endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
4949

5050

51-
extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
51+
extern int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
5252
u32 ointsize, const __be32 *addr,
5353
struct of_irq *out_irq);
54-
extern int of_irq_map_one(struct device_node *device, int index,
54+
extern int of_irq_parse_one(struct device_node *device, int index,
5555
struct of_irq *out_irq);
5656
extern unsigned int irq_create_of_mapping(struct device_node *controller,
5757
const u32 *intspec,

include/linux/of_pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
struct pci_dev;
88
struct of_irq;
9-
int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq);
9+
int of_irq_parse_pci(const struct pci_dev *pdev, struct of_irq *out_irq);
1010

1111
struct device_node;
1212
struct device_node *of_pci_find_child_device(struct device_node *parent,

0 commit comments

Comments
 (0)