diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-10-11 12:21:51 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 22:14:22 +0400 |
commit | f33d9bd50478c9a969b65f58feb6b69a3ad478cb (patch) | |
tree | 90f7455da171aa2b7558d5921f199015b5ab9a0b /drivers/char/tpm/tpm_atmel.c | |
parent | 5a2b4062f5adf2218b9b021e1c33f374bf142cb2 (diff) | |
download | linux-f33d9bd50478c9a969b65f58feb6b69a3ad478cb.tar.xz |
[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_atmel.c')
-rw-r--r-- | drivers/char/tpm/tpm_atmel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index ad8ffe49256f..1ab0896070be 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c @@ -184,7 +184,9 @@ static int __init init_atmel(void) unsigned long base; struct tpm_chip *chip; - driver_register(&atml_drv); + rc = driver_register(&atml_drv); + if (rc) + return rc; if ((iobase = atmel_get_base_addr(&base, ®ion_size)) == NULL) { rc = -ENODEV; @@ -195,10 +197,8 @@ static int __init init_atmel(void) (atmel_request_region (tpm_atmel.base, region_size, "tpm_atmel0") == NULL) ? 0 : 1; - - if (IS_ERR - (pdev = - platform_device_register_simple("tpm_atmel", -1, NULL, 0))) { + pdev = platform_device_register_simple("tpm_atmel", -1, NULL, 0); + if (IS_ERR(pdev)) { rc = PTR_ERR(pdev); goto err_rel_reg; } |