]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tpm_tis: Use platform_get_irq
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 4 May 2017 15:53:24 +0000 (09:53 -0600)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 13 Jun 2017 19:02:08 +0000 (22:02 +0300)
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")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jerry Snitselaar <jsnitsel@redhat.com> (with TPM 2.0)
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> (with TPM 1.2)
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_tis.c

index 56ce2bb19166935c72503c311b51ad4b98e8f6cd..1807b284326b88f94db762b8bd5d135360d0a16e 100644 (file)
@@ -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