Re: [PATCH] Missing include in include/asm-powerpc/prom.h
From: Mathieu Desnoyers <hidden>
Date: 2007-02-05 20:56:42
Also in:
lkml
* Benjamin Herrenschmidt (benh@kernel.crashing.org) wrote:
On Mon, 2007-02-05 at 09:29 -0500, Mathieu Desnoyers wrote:quoted
Missing include in include/asm-powerpc/prom.h =20 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.=20 I'd rather not do that.... better to move of_irq_to_resource() to prom_parse.c=20 =20
Thanks, this patch should apply on top of the previous patch in this thread. Signed-off-by: Mathieu Desnoyers <redacted>
--- 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 i=ndex, 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 =3D irq_of_parse_and_map(dev, index);
+
+ /* Only dereference the resource if both the
+ * resource and the irq are valid. */
+ if (r && irq !=3D NO_IRQ) {
+ r->start =3D r->end =3D irq;
+ r->flags =3D 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);
=20
-static inline int of_irq_to_resource(struct device_node *dev, int index, s=
truct resource *r)
-{
- int irq =3D irq_of_parse_and_map(dev, index);
-
- /* Only dereference the resource if both the
- * resource and the irq are valid. */
- if (r && irq !=3D NO_IRQ) {
- r->start =3D r->end =3D irq;
- r->flags =3D IORESOURCE_IRQ;
- }
-
- return irq;
-}
-
+extern int of_irq_to_resource(struct device_node *dev, int index,
+ struct resource *r);
=20
#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */
--=20
Mathieu Desnoyers
Computer Engineering Graduate Student, =C9cole Polytechnique de Montr=E9al
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68