linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make sure to of_node_get() the result of pci_device_to_OF_node()
@ 2007-09-17  6:03 Michael Ellerman
  2007-09-28  6:47 ` Michael Ellerman
  2007-10-02  5:09 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Ellerman @ 2007-09-17  6:03 UTC (permalink / raw)
  To: linuxppc-dev

pci_device_to_OF_node() returns the device node attached to a PCI device,
but doesn't actually grab a reference - we need to do it ourselves.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/platforms/cell/axon_msi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 57a6149..2b2dfcc 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -119,7 +119,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev *dev)
 	const phandle *ph;
 	struct axon_msic *msic = NULL;
 
-	dn = pci_device_to_OF_node(dev);
+	dn = of_node_get(pci_device_to_OF_node(dev));
 	if (!dn) {
 		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
 		return NULL;
@@ -176,7 +176,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
 	int len;
 	const u32 *prop;
 
-	dn = pci_device_to_OF_node(dev);
+	dn = of_node_get(pci_device_to_OF_node(dev));
 	if (!dn) {
 		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
 		return -ENODEV;
-- 
1.5.1.3.g7a33b

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make sure to of_node_get() the result of pci_device_to_OF_node()
  2007-09-17  6:03 [PATCH] Make sure to of_node_get() the result of pci_device_to_OF_node() Michael Ellerman
@ 2007-09-28  6:47 ` Michael Ellerman
  2007-10-02  5:09 ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2007-09-28  6:47 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Arnd Bergmann

[-- Attachment #1: Type: text/plain, Size: 1583 bytes --]

On Mon, 2007-09-17 at 16:03 +1000, Michael Ellerman wrote:
> pci_device_to_OF_node() returns the device node attached to a PCI device,
> but doesn't actually grab a reference - we need to do it ourselves.

Hi Paul,

Can you stick this in your 24 tree for the moment, the warnings it fixes
are giving people the willys. I'll look at the proper fix of having
pci_device_to_OF_node() take the reference and fixing all the callers.

cheers


> diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
> index 57a6149..2b2dfcc 100644
> --- a/arch/powerpc/platforms/cell/axon_msi.c
> +++ b/arch/powerpc/platforms/cell/axon_msi.c
> @@ -119,7 +119,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev *dev)
>  	const phandle *ph;
>  	struct axon_msic *msic = NULL;
>  
> -	dn = pci_device_to_OF_node(dev);
> +	dn = of_node_get(pci_device_to_OF_node(dev));
>  	if (!dn) {
>  		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
>  		return NULL;
> @@ -176,7 +176,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
>  	int len;
>  	const u32 *prop;
>  
> -	dn = pci_device_to_OF_node(dev);
> +	dn = of_node_get(pci_device_to_OF_node(dev));
>  	if (!dn) {
>  		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
>  		return -ENODEV;
-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make sure to of_node_get() the result of pci_device_to_OF_node()
  2007-09-17  6:03 [PATCH] Make sure to of_node_get() the result of pci_device_to_OF_node() Michael Ellerman
  2007-09-28  6:47 ` Michael Ellerman
@ 2007-10-02  5:09 ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2007-10-02  5:09 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev


On Mon, 2007-09-17 at 16:03 +1000, Michael Ellerman wrote:
> pci_device_to_OF_node() returns the device node attached to a PCI device,
> but doesn't actually grab a reference - we need to do it ourselves.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/platforms/cell/axon_msi.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
> index 57a6149..2b2dfcc 100644
> --- a/arch/powerpc/platforms/cell/axon_msi.c
> +++ b/arch/powerpc/platforms/cell/axon_msi.c
> @@ -119,7 +119,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev *dev)
>  	const phandle *ph;
>  	struct axon_msic *msic = NULL;
>  
> -	dn = pci_device_to_OF_node(dev);
> +	dn = of_node_get(pci_device_to_OF_node(dev));
>  	if (!dn) {
>  		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
>  		return NULL;
> @@ -176,7 +176,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
>  	int len;
>  	const u32 *prop;
>  
> -	dn = pci_device_to_OF_node(dev);
> +	dn = of_node_get(pci_device_to_OF_node(dev));
>  	if (!dn) {
>  		dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
>  		return -ENODEV;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-02  5:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17  6:03 [PATCH] Make sure to of_node_get() the result of pci_device_to_OF_node() Michael Ellerman
2007-09-28  6:47 ` Michael Ellerman
2007-10-02  5:09 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).