Skip to content

Commit

Permalink
tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device
Browse files Browse the repository at this point in the history
This fixes a build failure if CONFIG_PNP is set but CONFIG_ACPI is not:
drivers/char/tpm/tpm_tis.c: In function ?tpm_tis_pnp_init?:
drivers/char/tpm/tpm_tis.c:912:45: error: invalid type argument of
?->? (have ?int?)
   acpi_dev_handle = pnp_acpi_device(pnp_dev)->handle;

If CONFIG_PNPACPI is not set pnp_acpi_device is defined as 0 and thus
accesing the handle is not possible.

Fixes: 0dc5536 ("tpm: fix raciness of PPI interface lookup")
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: James Morris <james.l.morris@oracle.com>
  • Loading branch information
Peter Huewe authored and James Morris committed Jan 22, 2015
1 parent 9d5a5f6 commit 961be7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,10 @@ static int tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
if (is_itpm(pnp_dev))
itpm = true;

#ifdef CONFIG_ACPI
if (pnp_acpi_device(pnp_dev))
acpi_dev_handle = pnp_acpi_device(pnp_dev)->handle;
#endif

return tpm_tis_init(&pnp_dev->dev, acpi_dev_handle, start, len, irq);
}
Expand Down

0 comments on commit 961be7e

Please sign in to comment.