aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-parport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-parport.c')
-rw-r--r--drivers/i2c/busses/i2c-parport.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 7e2e8cd1c14a..934bd55bae15 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -241,9 +241,14 @@ static struct parport_driver i2c_parport_driver = {
241 241
242static int __init i2c_parport_init(void) 242static int __init i2c_parport_init(void)
243{ 243{
244 if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { 244 if (type < 0) {
245 printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
246 return -ENODEV;
247 }
248
249 if (type >= ARRAY_SIZE(adapter_parm)) {
245 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); 250 printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
246 type = 0; 251 return -ENODEV;
247 } 252 }
248 253
249 return parport_register_driver(&i2c_parport_driver); 254 return parport_register_driver(&i2c_parport_driver);