public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Peter Huewe <peterhuewe@gmx•de>
To: Stephen Rothwell <sfr@canb•auug.org.au>
Cc: linux-next <linux-next@vger•kernel.org>,
	tpmdd-devel@lists•sourceforge.net,
	Jarkko Sakkinen <jarkko.sakkinen@linux•intel.com>,
	Jim Davis <jim.epost@gmail•com>, Peter Huewe <peterhuewe@gmx•de>
Subject: [PATCH] tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device
Date: Wed, 21 Jan 2015 21:40:15 +0100	[thread overview]
Message-ID: <1421872815-16644-1-git-send-email-peterhuewe@gmx.de> (raw)

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>
---
 drivers/char/tpm/tpm_tis.c | 2 ++
 1 file changed, 2 insertions(+)

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);
 }
-- 
2.0.5

             reply	other threads:[~2015-01-21 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 20:40 Peter Huewe [this message]
2015-01-21 21:23 ` [PATCH] tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device Stephen Rothwell
2015-01-21 21:34   ` Stephen Rothwell
2015-01-21 22:40     ` Peter Hüwe
2015-01-21 23:05       ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2015-01-21 23:42 Peter Huewe
2015-01-22  2:22 ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421872815-16644-1-git-send-email-peterhuewe@gmx.de \
    --to=peterhuewe@gmx$(echo .)de \
    --cc=jarkko.sakkinen@linux$(echo .)intel.com \
    --cc=jim.epost@gmail$(echo .)com \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=tpmdd-devel@lists$(echo .)sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox