[PATCH] i2c: Use ARRAY_SIZE macro
[safe/jmp/linux-2.6] / drivers / i2c / busses / i2c-parport.c
index 2854d85..7e2e8cd 100644 (file)
@@ -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);
 }