[tpmdd-devel,1/7] tpm_tis: Use devm_free_irq not free_irq
diff mbox

Message ID 1448485536-7282-2-git-send-email-jgunthorpe@obsidianresearch.com
State New
Headers show

Commit Message

Jason Gunthorpe Nov. 25, 2015, 9:05 p.m. UTC
The interrupt is always allocated with devm_request_irq so it
must always be freed with devm_free_irq.

Fixes: 448e9c55c12d ("tpm_tis: verify interrupt during init")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 drivers/char/tpm/tpm_tis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jarkko Sakkinen Nov. 30, 2015, 4:29 p.m. UTC | #1
On Wed, Nov 25, 2015 at 02:05:30PM -0700, Jason Gunthorpe wrote:
> The interrupt is always allocated with devm_request_irq so it
> must always be freed with devm_free_irq.

I can apply this so no need to include this to v2 (it's kind of
orthogonal to other patches right?)

/Jarkko

> 
> Fixes: 448e9c55c12d ("tpm_tis: verify interrupt during init")
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
>  drivers/char/tpm/tpm_tis.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index d88d06a4b94c..c08a09a5602f 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -401,7 +401,7 @@ static void disable_interrupts(struct tpm_chip *chip)
>  	iowrite32(intmask,
>  		  chip->vendor.iobase +
>  		  TPM_INT_ENABLE(chip->vendor.locality));
> -	free_irq(chip->vendor.irq, chip);
> +	devm_free_irq(chip->pdev, chip->vendor.irq, chip);
>  	chip->vendor.irq = 0;
>  }
>  
> -- 
> 2.1.4
> 

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
Jarkko Sakkinen Nov. 30, 2015, 4:46 p.m. UTC | #2
On Mon, Nov 30, 2015 at 06:29:03PM +0200, Jarkko Sakkinen wrote:
> On Wed, Nov 25, 2015 at 02:05:30PM -0700, Jason Gunthorpe wrote:
> > The interrupt is always allocated with devm_request_irq so it
> > must always be freed with devm_free_irq.
> 
> I can apply this so no need to include this to v2 (it's kind of
> orthogonal to other patches right?)

Applied and pushed to

https://github.com/jsakkine/linux-tpmdd/commits/master

I also dropped Martins ordinal duration patch from there.

/Jarkko

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140

Patch
diff mbox

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index d88d06a4b94c..c08a09a5602f 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -401,7 +401,7 @@  static void disable_interrupts(struct tpm_chip *chip)
 	iowrite32(intmask,
 		  chip->vendor.iobase +
 		  TPM_INT_ENABLE(chip->vendor.locality));
-	free_irq(chip->vendor.irq, chip);
+	devm_free_irq(chip->pdev, chip->vendor.irq, chip);
 	chip->vendor.irq = 0;
 }