aboutsummaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorJason Gunthorpe2017-05-04 09:53:24 -0600
committerJarkko Sakkinen2017-06-13 22:02:08 +0300
commitfc0e132229a7ef5a8096e2876463403df0767b1b (patch)
treef5ae0768c287d1b7783a41c2f05496df7b70a385 /drivers/char
parentd27f81f061bbde627ac4fbd735114f9ea2c63615 (diff)
tpm_tis: Use platform_get_irq
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm_tis.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 56ce2bb19166..1807b284326b 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