From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>,
linuxppc-dev@ozlabs.org, paulus@samba.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Missing include in include/asm-powerpc/prom.h
Date: Mon, 5 Feb 2007 15:56:36 -0500 [thread overview]
Message-ID: <20070205205636.GA14589@Krystal> (raw)
In-Reply-To: <1170706469.2620.124.camel@localhost.localdomain>
* Benjamin Herrenschmidt (benh@kernel.crashing.org) wrote:
> On Mon, 2007-02-05 at 09:29 -0500, Mathieu Desnoyers wrote:
> > 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 <mathieu.desnoyers@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 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
WARNING: multiple messages have this Message-ID (diff)
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
paulus@samba.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Missing include in include/asm-powerpc/prom.h
Date: Mon, 5 Feb 2007 15:56:36 -0500 [thread overview]
Message-ID: <20070205205636.GA14589@Krystal> (raw)
In-Reply-To: <1170706469.2620.124.camel@localhost.localdomain>
* Benjamin Herrenschmidt (benh@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@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
next prev parent reply other threads:[~2007-02-05 20:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-05 14:29 [PATCH] Missing include in include/asm-powerpc/prom.h Mathieu Desnoyers
2007-02-05 20:14 ` Benjamin Herrenschmidt
2007-02-05 20:14 ` Benjamin Herrenschmidt
2007-02-05 20:56 ` Mathieu Desnoyers [this message]
2007-02-05 20:56 ` Mathieu Desnoyers
2007-02-06 0:36 ` Paul Mackerras
2007-02-06 0:36 ` Paul Mackerras
2007-02-06 1:03 ` [PATCH] Powerpc move of_irq_to_resource from prom.h to prom_parse.c Mathieu Desnoyers
2007-02-06 1:03 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070205205636.GA14589@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.