[tpmdd-devel,v2,2/3] tpm_tis: Use platform_get_irq

Message ID 1493913205-18276-3-git-send-email-jgunthorpe@obsidianresearch.com
State New
Headers show

Commit Message

Jason Gunthorpe May 4, 2017, 3:53 p.m.
Replace the open coded IORESOURCE_IRQ with platform_get_irq, which
supports more cases.

Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 drivers/char/tpm/tpm_tis.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Jarkko Sakkinen May 8, 2017, 11:45 p.m. | #1
On Thu, May 04, 2017 at 09:53:24AM -0600, Jason Gunthorpe wrote:
> Replace the open coded IORESOURCE_IRQ with platform_get_irq, which
> supports more cases.
> 
> Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

> ---
>  drivers/char/tpm/tpm_tis.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 56ce2bb1916693..1807b284326b88 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -332,10 +332,8 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
>  	}
>  	tpm_info.res = *res;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (res) {
> -		tpm_info.irq = res->start;
> -	} else {
> +	tpm_info.irq = platform_get_irq(pdev, 0);
> +	if (tpm_info.irq <= 0) {
>  		if (pdev != force_pdev)
>  			tpm_info.irq = -1;
>  		else
> -- 
> 2.7.4
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jarkko Sakkinen May 8, 2017, 11:49 p.m. | #2
On Thu, May 04, 2017 at 09:53:24AM -0600, Jason Gunthorpe wrote:
> Replace the open coded IORESOURCE_IRQ with platform_get_irq, which
> supports more cases.
> 
> Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

> ---
>  drivers/char/tpm/tpm_tis.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 56ce2bb1916693..1807b284326b88 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -332,10 +332,8 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
>  	}
>  	tpm_info.res = *res;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (res) {
> -		tpm_info.irq = res->start;
> -	} else {
> +	tpm_info.irq = platform_get_irq(pdev, 0);
> +	if (tpm_info.irq <= 0) {
>  		if (pdev != force_pdev)
>  			tpm_info.irq = -1;
>  		else
> -- 
> 2.7.4
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jarkko Sakkinen May 9, 2017, 2:03 p.m. | #3
On Tue, May 09, 2017 at 02:45:39AM +0300, Jarkko Sakkinen wrote:
> On Thu, May 04, 2017 at 09:53:24AM -0600, Jason Gunthorpe wrote:
> > Replace the open coded IORESOURCE_IRQ with platform_get_irq, which
> > supports more cases.
> > 
> > Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> > Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jarkko Sakkinen May 9, 2017, 2:21 p.m. | #4
On Tue, May 09, 2017 at 05:03:45PM +0300, Jarkko Sakkinen wrote:
> On Tue, May 09, 2017 at 02:45:39AM +0300, Jarkko Sakkinen wrote:
> > On Thu, May 04, 2017 at 09:53:24AM -0600, Jason Gunthorpe wrote:
> > > Replace the open coded IORESOURCE_IRQ with platform_get_irq, which
> > > supports more cases.
> > > 
> > > Fixes: 00194826e6be ("tpm_tis: Clean up the force=1 module parameter")
> > > Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > 
> > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> 
> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Applied.

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 56ce2bb1916693..1807b284326b88 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -332,10 +332,8 @@  static int tpm_tis_plat_probe(struct platform_device *pdev)
 	}
 	tpm_info.res = *res;
 
-	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (res) {
-		tpm_info.irq = res->start;
-	} else {
+	tpm_info.irq = platform_get_irq(pdev, 0);
+	if (tpm_info.irq <= 0) {
 		if (pdev != force_pdev)
 			tpm_info.irq = -1;
 		else