]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/busses/i2c-parport-light.c
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
[linux-2.6-omap-h63xx.git] / drivers / i2c / busses / i2c-parport-light.c
index c63025a4c8613744fb1a6e7706e018188391a5b3..4bc42810b9aadb7fddfe703e5bf5d3ac17e34a47 100644 (file)
@@ -103,7 +103,6 @@ static struct i2c_algo_bit_data parport_algo_data = {
        .getsda         = parport_getsda,
        .getscl         = parport_getscl,
        .udelay         = 50,
-       .mdelay         = 50,
        .timeout        = HZ,
 }; 
 
@@ -121,9 +120,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) {
@@ -159,7 +163,7 @@ static void __exit i2c_parport_exit(void)
        if (adapter_parm[type].init.val)
                line_set(0, &adapter_parm[type].init);
 
-       i2c_bit_del_bus(&parport_adapter);
+       i2c_del_adapter(&parport_adapter);
        release_region(base, 3);
 }