diff mbox

tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device

Message ID 1421883770-13720-1-git-send-email-peterhuewe@gmx.de (mailing list archive)
State New, archived
Headers show

Pull-request

https://github.com/PeterHuewe/linux-tpmdd

Commit Message

Peter Huewe Jan. 21, 2015, 11:42 p.m. UTC
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: 0dc553652102 ("tpm: fix raciness of PPI interface lookup")
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
Hi James unfortunately there was another build-error in -next. :(
Can you apply this patch directly?
otherwise you can also pull directly from my tree:
The following changes since commit 743410a03bbf110da8942a715cf1358344ecc281:
  tpm: fix format string error in tpm-chip.c (2015-01-20 21:28:36 +0100)
are available in the git repository at:
  https://github.com/PeterHuewe/linux-tpmdd
for you to fetch changes up to d4989d9f693b9502f9288da5db279c2f8c2e50be:
tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device (2015-01-21 21:35:26 +0100)

Thanks,
Peter


 drivers/char/tpm/tpm_tis.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

James Morris Jan. 22, 2015, 2:22 a.m. UTC | #1
On Thu, 22 Jan 2015, Peter Huewe wrote:

> 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: 0dc553652102 ("tpm: fix raciness of PPI interface lookup")
> Reported-by: Jim Davis <jim.epost@gmail.com>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>

Applied.
diff mbox

Patch

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 20a61bc98db8..6725bef7cb96 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -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);
 }