]> err.no Git - linux-2.6/blobdiff - drivers/i2c/busses/i2c-parport-light.c
[PATCH] i2c-parport: Make type parameter mandatory
[linux-2.6] / drivers / i2c / busses / i2c-parport-light.c
index c63025a4c8613744fb1a6e7706e018188391a5b3..e09ebbb2f9f09dc14dc00129211c82cfd4da95cb 100644 (file)
@@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = {
 
 static int __init i2c_parport_init(void)
 {
-       if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
+       if (type < 0) {
+               printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
+               return -ENODEV;
+       }
+
+       if (type >= ARRAY_SIZE(adapter_parm)) {
                printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
-               type = 0;
+               return -ENODEV;
        }
 
        if (base == 0) {