Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jason Gunthorpe and committed by
Jarkko Sakkinen
fc0e1322 d27f81f0

+2 -4
+2 -4
drivers/char/tpm/tpm_tis.c
··· 332 332 } 333 333 tpm_info.res = *res; 334 334 335 - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 336 - if (res) { 337 - tpm_info.irq = res->start; 338 - } else { 335 + tpm_info.irq = platform_get_irq(pdev, 0); 336 + if (tpm_info.irq <= 0) { 339 337 if (pdev != force_pdev) 340 338 tpm_info.irq = -1; 341 339 else