Skip to content

Commit

Permalink
tpm_tis: Use platform_get_irq
Browse files Browse the repository at this point in the history
Replace the open coded IORESOURCE_IRQ with platform_get_irq, which
supports more cases.

Fixes: 0019482 ("tpm_tis: Clean up the force=1 module parameter")
Signed-off-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Tested-by: Jerry Snitselaar <[email protected]> (with TPM 2.0)
Tested-by: Jarkko Sakkinen <[email protected]> (with TPM 1.2)
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
jgunthorpe authored and Jarkko Sakkinen committed Jun 13, 2017
1 parent d27f81f commit fc0e132
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc0e132

Please sign in to comment.