linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: stefanb@linux.vnet.ibm.com, tpmdd-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: srajiv@linux.vnet.ibm.com,
	Stefan Berger <stefan@linux.vnet.ibm.com>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: [PATCH 2/2] tpm_tis: Clean up after module_param cleanup
Date: Fri, 20 Jan 2012 12:58:50 -0500	[thread overview]
Message-ID: <20120120175931.685896848@linux.vnet.ibm.com> (raw)
In-Reply-To: 20120120175848.310554335@linux.vnet.ibm.com

[-- Attachment #1: tpm_tis_itpm_bool_fix.diff --]
[-- Type: text/plain, Size: 1490 bytes --]

Commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7 changed the
itpm module parameter from int to bool. Some other changes
need to be done to clean up after this change.

Signed-off-by: Stefan Berger <stefan@linux.vnet.ibm.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>

---
 drivers/char/tpm/tpm_tis.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/char/tpm/tpm_tis.c
===================================================================
--- linux-2.6.orig/drivers/char/tpm/tpm_tis.c
+++ linux-2.6/drivers/char/tpm/tpm_tis.c
@@ -367,7 +367,7 @@ static int probe_itpm(struct tpm_chip *c
 		0x00, 0x00, 0x00, 0xf1
 	};
 	size_t len = sizeof(cmd_getticks);
-	int rem_itpm = itpm;
+	bool rem_itpm = itpm;
 	u16 vendor = ioread16(chip->vendor.iobase + TPM_DID_VID(0));
 
 	/* probe only iTPMS */
@@ -510,7 +510,7 @@ static int tpm_tis_init(struct device *d
 			resource_size_t len, unsigned int irq)
 {
 	u32 vendor, intfcaps, intmask;
-	int rc, i, irq_s, irq_e;
+	int rc, i, irq_s, irq_e, probe;
 	struct tpm_chip *chip;
 
 	if (!(chip = tpm_register_hardware(dev, &tpm_tis)))
@@ -540,11 +540,12 @@ static int tpm_tis_init(struct device *d
 		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
 
 	if (!itpm) {
-		itpm = probe_itpm(chip);
-		if (itpm < 0) {
+		probe = probe_itpm(chip);
+		if (probe < 0) {
 			rc = -ENODEV;
 			goto out_err;
 		}
+		itpm = (probe == 0) ? 0 : 1;
 	}
 
 	if (itpm)


  parent reply	other threads:[~2012-01-20 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 17:58 [PATCH 0/2] tpm_tis: Some smaller fixes Stefan Berger
2012-01-20 17:58 ` [PATCH 1/2] Only probe iTPMs Stefan Berger
2012-02-03 17:35   ` Rajiv Andrade
2012-01-20 17:58 ` Stefan Berger [this message]
2012-02-03 17:35   ` [PATCH 2/2] tpm_tis: Clean up after module_param cleanup Rajiv Andrade

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=20120120175931.685896848@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=srajiv@linux.vnet.ibm.com \
    --cc=stefan@linux.vnet.ibm.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).