public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: vme: Fix warning in free_irq for ca91cx42
@ 2010-10-27 10:38 Martyn Welch
  2010-10-27 10:42 ` Martyn Welch
  0 siblings, 1 reply; 2+ messages in thread
From: Martyn Welch @ 2010-10-27 10:38 UTC (permalink / raw)
  To: greg; +Cc: devel, linux-kernel

As discovered by Emilio Cota for the tsi148, the cookie passed to request_irq
isn't the same as the one passed to free_irq.

Fix it by passing the same cookie to both functions.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_ca91cx42.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 1f2089f..5f7f458 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -242,9 +242,11 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
 	return 0;
 }
 
-static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
+static void ca91cx42_irq_exit(struct vme_driver *ca91cx42_bridge,
 	struct pci_dev *pdev)
 {
+	struct ca91cx42_driver *bridge = ca91cx42_bridge->driver_priv;
+
 	/* Disable interrupts from PCI to VME */
 	iowrite32(0, bridge->base + VINT_EN);
 
@@ -253,7 +255,7 @@ static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
 	/* Clear Any Pending PCI Interrupts */
 	iowrite32(0x00FFFFFF, bridge->base + LINT_STAT);
 
-	free_irq(pdev->irq, pdev);
+	free_irq(pdev->irq, ca91cx42_bridge);
 }
 
 /*
@@ -1815,7 +1817,7 @@ err_master:
 		kfree(master_image);
 	}
 
-	ca91cx42_irq_exit(ca91cx42_device, pdev);
+	ca91cx42_irq_exit(ca91cx42_bridge, pdev);
 err_irq:
 err_test:
 	iounmap(ca91cx42_device->base);
@@ -1899,7 +1901,7 @@ void ca91cx42_remove(struct pci_dev *pdev)
 		kfree(master_image);
 	}
 
-	ca91cx42_irq_exit(bridge, pdev);
+	ca91cx42_irq_exit(ca91cx42_bridge, pdev);
 
 	iounmap(bridge->base);
 


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH] Staging: vme: Fix warning in free_irq for ca91cx42
  2010-10-27 10:38 [PATCH] Staging: vme: Fix warning in free_irq for ca91cx42 Martyn Welch
@ 2010-10-27 10:42 ` Martyn Welch
  0 siblings, 0 replies; 2+ messages in thread
From: Martyn Welch @ 2010-10-27 10:42 UTC (permalink / raw)
  To: greg; +Cc: devel, linux-kernel

Greg,

Please dis-regard this patch - trying to do to many things at once leads
to mistakes...

Martyn

On 27/10/10 11:38, Martyn Welch wrote:
> As discovered by Emilio Cota for the tsi148, the cookie passed to request_irq
> isn't the same as the one passed to free_irq.
> 
> Fix it by passing the same cookie to both functions.
> 
> Signed-off-by: Martyn Welch <martyn.welch@ge.com>
> ---
> 
>  drivers/staging/vme/bridges/vme_ca91cx42.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
> index 1f2089f..5f7f458 100644
> --- a/drivers/staging/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
> @@ -242,9 +242,11 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
>  	return 0;
>  }
>  
> -static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
> +static void ca91cx42_irq_exit(struct vme_driver *ca91cx42_bridge,
>  	struct pci_dev *pdev)
>  {
> +	struct ca91cx42_driver *bridge = ca91cx42_bridge->driver_priv;
> +
>  	/* Disable interrupts from PCI to VME */
>  	iowrite32(0, bridge->base + VINT_EN);
>  
> @@ -253,7 +255,7 @@ static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
>  	/* Clear Any Pending PCI Interrupts */
>  	iowrite32(0x00FFFFFF, bridge->base + LINT_STAT);
>  
> -	free_irq(pdev->irq, pdev);
> +	free_irq(pdev->irq, ca91cx42_bridge);
>  }
>  
>  /*
> @@ -1815,7 +1817,7 @@ err_master:
>  		kfree(master_image);
>  	}
>  
> -	ca91cx42_irq_exit(ca91cx42_device, pdev);
> +	ca91cx42_irq_exit(ca91cx42_bridge, pdev);
>  err_irq:
>  err_test:
>  	iounmap(ca91cx42_device->base);
> @@ -1899,7 +1901,7 @@ void ca91cx42_remove(struct pci_dev *pdev)
>  		kfree(master_image);
>  	}
>  
> -	ca91cx42_irq_exit(bridge, pdev);
> +	ca91cx42_irq_exit(ca91cx42_bridge, pdev);
>  
>  	iounmap(bridge->base);
>  
> 
> 
> --
> Martyn Welch (Principal Software Engineer)   |   Registered in England and
> GE Intelligent Platforms                     |   Wales (3828642) at 100
> T +44(0)127322748                            |   Barbirolli Square, Manchester,
> E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

end of thread, other threads:[~2010-10-27 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 10:38 [PATCH] Staging: vme: Fix warning in free_irq for ca91cx42 Martyn Welch
2010-10-27 10:42 ` Martyn Welch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox