summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-parport.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-01-09 23:19:51 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2006-02-06 12:02:15 -0800
commit7e3d7db52469f6bcfbfd2d3d00dd17da573facd9 (patch)
treec6090fda544c24ddf169177ee4596121b8bd10a6 /drivers/i2c/busses/i2c-parport.c
parent8104a9a9c9ad8c849d931c46ef6841b23d1fc729 (diff)
[PATCH] i2c: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]). Some trailing whitespaces are also removed. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-parport.c')
-rw-r--r--drivers/i2c/busses/i2c-parport.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 2854d858fc9b..7e2e8cd1c14a 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -241,14 +241,11 @@ static struct parport_driver i2c_parport_driver = {
static int __init i2c_parport_init(void)
{
- int type_count;
-
- type_count = sizeof(adapter_parm)/sizeof(struct adapter_parm);
- if (type < 0 || type >= type_count) {
+ if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
type = 0;
}
-
+
return parport_register_driver(&i2c_parport_driver);
}