|
@@ -121,14 +121,11 @@ static struct i2c_adapter parport_adapter = {
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (base == 0) {
|
|
|
printk(KERN_INFO "i2c-parport: using default base 0x%x\n", DEFAULT_BASE);
|
|
|
base = DEFAULT_BASE;
|
|
@@ -152,7 +149,7 @@ static int __init i2c_parport_init(void)
|
|
|
release_region(base, 3);
|
|
|
return -ENODEV;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|