summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm_atmel.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2005-10-31 02:03:28 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-31 04:37:29 +0300
commitb888c87b7498557d1dbb9de3d4b8402b1bb89193 (patch)
tree31d43ab177ef00fbef3d15c9513ba737029b6d48 /drivers/char/tpm/tpm_atmel.c
parent1b8333b02aa281a2849331ad62ee595c46a1c5ac (diff)
downloadlinux-b888c87b7498557d1dbb9de3d4b8402b1bb89193.tar.xz
[PATCH] tpm-tidies
- Various whitespace fixes - Use kzalloc() 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.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
index a9100ad3d030..d12ac1a346b5 100644
--- a/drivers/char/tpm/tpm_atmel.c
+++ b/drivers/char/tpm/tpm_atmel.c
@@ -40,7 +40,7 @@ enum tpm_atmel_read_status {
ATML_STATUS_READY = 0x08
};
-static int tpm_atml_recv(struct tpm_chip *chip, u8 * buf, size_t count)
+static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
{
u8 status, *hdr = buf;
u32 size;
@@ -100,7 +100,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 * buf, size_t count)
return size;
}
-static int tpm_atml_send(struct tpm_chip *chip, u8 * buf, size_t count)
+static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
{
int i;
@@ -159,12 +159,12 @@ static struct tpm_vendor_specific tpm_atmel = {
.miscdev = { .fops = &atmel_ops, },
};
-static struct platform_device *pdev = NULL;
+static struct platform_device *pdev;
static void __devexit tpm_atml_remove(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
- if ( chip ) {
+ if (chip) {
release_region(chip->vendor->base, 2);
tpm_remove_hardware(chip->dev);
}
@@ -201,19 +201,17 @@ static int __init init_atmel(void)
(tpm_read_index(TPM_ADDR, 0x01) != 0x01 ))
return -ENODEV;
- pdev = kmalloc(sizeof(struct platform_device), GFP_KERNEL);
+ pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
if ( !pdev )
return -ENOMEM;
- memset(pdev, 0, sizeof(struct platform_device));
-
pdev->name = "tpm_atmel0";
pdev->id = -1;
pdev->num_resources = 0;
pdev->dev.release = tpm_atml_remove;
pdev->dev.driver = &atml_drv;
- if ((rc=platform_device_register(pdev)) < 0) {
+ if ((rc = platform_device_register(pdev)) < 0) {
kfree(pdev);
pdev = NULL;
return rc;
@@ -234,7 +232,8 @@ static int __init init_atmel(void)
return rc;
}
- dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", tpm_atmel.base);
+ dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n",
+ tpm_atmel.base);
return 0;
}