* [patch] TPM: handle errors from probe_itpm()
[not found] <87ehw6sesk.fsf@rustcorp.com.au>
@ 2012-01-03 13:17 ` Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-01-03 13:17 UTC (permalink / raw)
To: Debora Velarde
Cc: Rajiv Andrade, Marcel Selhorst, Rusty Russell, tpmdd-devel,
linux-kernel, kernel-janitors
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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-03 13:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87ehw6sesk.fsf@rustcorp.com.au>
2012-01-03 13:17 ` [patch] TPM: handle errors from probe_itpm() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox