public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Debora Velarde <debora@linux.vnet.ibm.com>
Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
	Marcel Selhorst <m.selhorst@sirrix.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [patch] TPM: handle errors from probe_itpm()
Date: Tue, 03 Jan 2012 13:17:48 +0000	[thread overview]
Message-ID: <20120103131748.GA11575@elgon.mountain> (raw)
In-Reply-To: <87ehw6sesk.fsf@rustcorp.com.au>

We recently made itpm a bool in linux-next and it broke the error
handling here.  This patch also preserves the return codes from
probe_itpm() instead of always returning -ENODEV.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index a174862..08c6a07 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -538,11 +538,11 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
 		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
 
 	if (!itpm) {
-		itpm = probe_itpm(chip);
-		if (itpm < 0) {
-			rc = -ENODEV;
+		rc = probe_itpm(chip);
+		if (rc < 0)
 			goto out_err;
-		}
+		itpm = rc;
+		rc = 0;
 	}
 
 	if (itpm)

           reply	other threads:[~2012-01-03 13:17 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <87ehw6sesk.fsf@rustcorp.com.au>]

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=20120103131748.GA11575@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=debora@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.selhorst@sirrix.com \
    --cc=rusty@rustcorp.com.au \
    --cc=srajiv@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