aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-parport-light.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-parport-light.c')
-rw-r--r--drivers/i2c/busses/i2c-parport-light.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c
index c63025a4c861..e09ebbb2f9f0 100644
--- a/drivers/i2c/busses/i2c-parport-light.c
+++ b/drivers/i2c/busses/i2c-parport-light.c
@@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = {
121 121
122static int __init i2c_parport_init(void) 122static int __init i2c_parport_init(void)
123{ 123{
124 if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { 124 if (type < 0) {
125 printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
126 return -ENODEV;
127 }
128
129 if (type >= ARRAY_SIZE(adapter_parm)) {
125 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); 130 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
126 type = 0; 131 return -ENODEV;
127 } 132 }
128 133
129 if (base == 0) { 134 if (base == 0) {