summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_nsc.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 10:21:51 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 20:14:22 +0200
commitf33d9bd50478c9a969b65f58feb6b69a3ad478cb (patch)
tree90f7455da171aa2b7558d5921f199015b5ab9a0b /drivers/char/tpm/tpm_nsc.c
parent[PATCH] ext2: errors behaviour fix (diff)
downloadlinux-f33d9bd50478c9a969b65f58feb6b69a3ad478cb.tar.xz
linux-f33d9bd50478c9a969b65f58feb6b69a3ad478cb.zip
[PATCH] tpm: fix error handling
- handle sysfs error - handle driver model errors - de-obfuscate platform_device_register_simple() call, which included an assignment in between two function calls, in the same C statement. Signed-off-by: Jeff Garzik <jeff@garzik.org> Acked-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm/tpm_nsc.c')
-rw-r--r--drivers/char/tpm/tpm_nsc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 26287aace87d..608f73071bef 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -284,7 +284,7 @@ static struct device_driver nsc_drv = {
static int __init init_nsc(void)
{
int rc = 0;
- int lo, hi;
+ int lo, hi, err;
int nscAddrBase = TPM_ADDR;
struct tpm_chip *chip;
unsigned long base;
@@ -297,7 +297,9 @@ static int __init init_nsc(void)
return -ENODEV;
}
- driver_register(&nsc_drv);
+ err = driver_register(&nsc_drv);
+ if (err)
+ return err;
hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI);
lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO);