diff options
author | Mark M. Hoffman <mhoffman@lightlink.com> | 2006-03-23 10:50:25 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-14 14:18:34 -0400 |
commit | e97b81ddbb8b8c72b85330ac4a454a4513dcba8a (patch) | |
tree | b7be59895ee5cafdd5af5b4237f5b96b2812b180 /drivers/i2c/busses/i2c-parport.c | |
parent | 3cb8e1a92ef7588d3acdecf493ddddd0dd71a709 (diff) |
[PATCH] i2c-parport: Make type parameter mandatory
This patch forces the user to specify what type of adapter is present when
loading i2c-parport or i2c-parport-light. If none is specified, the driver
init simply fails - instead of assuming adapter type 0.
This alleviates the sometimes lengthy boot time delays which can be caused
by accidentally building one of these into a kernel along with several i2c
slave drivers that have lengthy probe routines (e.g. hwmon drivers).
Kconfig and documentation updated accordingly.
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-parport.c')
-rw-r--r-- | drivers/i2c/busses/i2c-parport.c | 9 |
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 | ||
242 | static int __init i2c_parport_init(void) | 242 | static 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); |