Skip to content

Commit

Permalink
sparc: Implement irq_of_parse_and_map() and irq_dispose_mapping().
Browse files Browse the repository at this point in the history
This allows more OF layer code to be shared between powerpc and
sparc.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 25, 2008
1 parent 2481d76 commit 4426621
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/sparc/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ static inline void of_node_put(struct device_node *node)
{
}

/* These routines are here to provide compatibility with how powerpc
* handles IRQ mapping for OF device nodes. We precompute and permanently
* register them in the of_device objects, whereas powerpc computes them
* on request.
*/
extern int irq_of_parse_and_map(struct device_node *node, int index);
#define irq_dispose_mapping(irq) do { } while (0)

/*
* NB: This is here while we transition from using asm/prom.h
* to linux/of.h
Expand Down
11 changes: 11 additions & 0 deletions arch/sparc/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
}
EXPORT_SYMBOL(of_find_device_by_node);

int irq_of_parse_and_map(struct device_node *node, int index)
{
struct of_device *op = of_find_device_by_node(node);

if (!op || index >= op->num_irqs)
return 0xffffffff;

return op->irqs[index];
}
EXPORT_SYMBOL(irq_of_parse_and_map);

#ifdef CONFIG_PCI
struct bus_type ebus_bus_type;
EXPORT_SYMBOL(ebus_bus_type);
Expand Down
11 changes: 11 additions & 0 deletions arch/sparc64/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
}
EXPORT_SYMBOL(of_find_device_by_node);

int irq_of_parse_and_map(struct device_node *node, int index)
{
struct of_device *op = of_find_device_by_node(node);

if (!op || index >= op->num_irqs)
return 0xffffffff;

return op->irqs[index];
}
EXPORT_SYMBOL(irq_of_parse_and_map);

#ifdef CONFIG_PCI
struct bus_type ebus_bus_type;
EXPORT_SYMBOL(ebus_bus_type);
Expand Down

0 comments on commit 4426621

Please sign in to comment.