[PATCH] Missing include in include/asm-powerpc/prom.h
Mathieu Desnoyers
mathieu.desnoyers at polymtl.ca
Tue Feb 6 07:56:36 EST 2007
* Benjamin Herrenschmidt (benh at kernel.crashing.org) wrote:
> On Mon, 2007-02-05 at 09:29 -0500, Mathieu Desnoyers wrote:
> > Missing include in include/asm-powerpc/prom.h
> >
> > include/asm-powerpc/prom.h needs to include asm/irq.h because it uses
> > irq_of_parse_and_map and NO_IRQ. It applies on 2.6.20.
>
> I'd rather not do that.... better to move of_irq_to_resource() to
> prom_parse.c
>
Thanks, this patch should apply on top of the previous patch in this thread.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -1003,3 +1003,18 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
return res;
}
EXPORT_SYMBOL_GPL(of_irq_map_one);
+
+int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
+{
+ int irq = irq_of_parse_and_map(dev, index);
+
+ /* Only dereference the resource if both the
+ * resource and the irq are valid. */
+ if (r && irq != NO_IRQ) {
+ r->start = r->end = irq;
+ r->flags = IORESOURCE_IRQ;
+ }
+
+ return irq;
+}
+EXPORT_SYMBOL_GPL(of_irq_to_resource);
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -335,20 +335,8 @@ extern int of_irq_map_one(struct device_node *device, int index,
struct pci_dev;
extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
-static inline int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
-{
- int irq = irq_of_parse_and_map(dev, index);
-
- /* Only dereference the resource if both the
- * resource and the irq are valid. */
- if (r && irq != NO_IRQ) {
- r->start = r->end = irq;
- r->flags = IORESOURCE_IRQ;
- }
-
- return irq;
-}
-
+extern int of_irq_to_resource(struct device_node *dev, int index,
+ struct resource *r);
#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */
--
Mathieu Desnoyers
Computer Engineering Graduate Student, École Polytechnique de Montréal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
More information about the Linuxppc-dev
mailing list