summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-parport-light.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-04-14 17:08:41 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-14 17:08:41 -0700
commit11f16971ceeb0f442e58f318b0cfde8eb35296bb (patch)
tree857d0975f65dcc81f7e0fe8ceabad183cd97e763 /drivers/i2c/busses/i2c-parport-light.c
parentbcdc084257352902103aca85c65ddbbba8f74732 (diff)
parente97b81ddbb8b8c72b85330ac4a454a4513dcba8a (diff)
downloadop-kernel-dev-11f16971ceeb0f442e58f318b0cfde8eb35296bb.zip
op-kernel-dev-11f16971ceeb0f442e58f318b0cfde8eb35296bb.tar.gz
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6: (78 commits) commit e97b81ddbb8b8c72b85330ac4a454a4513dcba8a Author: Mark M. Hoffman <mhoffman@lightlink.com> Date: Thu Mar 23 16:50:25 2006 +0100 [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-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 c63025a..e09ebbb 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 = {
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) {
OpenPOWER on IntegriCloud