diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-07 19:29:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-07 19:29:27 -0500 |
commit | b4669d66fb1488fd9cebe0b8da447cfeb86109ba (patch) | |
tree | 2beaba0e7d8acac9703667aff5f9bc9f4d4357d6 /drivers/i2c/busses/i2c-parport-light.c | |
parent | b43d4ddaec2b33fd6eaf0bed970c86ab08a52aaf (diff) | |
parent | c5e3fbf22ccba0879b174fab7ec0e322b1266c2c (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Diffstat (limited to 'drivers/i2c/busses/i2c-parport-light.c')
-rw-r--r-- | drivers/i2c/busses/i2c-parport-light.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c index 3e5eba9fcacb..c63025a4c861 100644 --- a/drivers/i2c/busses/i2c-parport-light.c +++ b/drivers/i2c/busses/i2c-parport-light.c | |||
@@ -121,14 +121,11 @@ static struct i2c_adapter parport_adapter = { | |||
121 | 121 | ||
122 | static int __init i2c_parport_init(void) | 122 | static int __init i2c_parport_init(void) |
123 | { | 123 | { |
124 | int type_count; | 124 | if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { |
125 | |||
126 | type_count = sizeof(adapter_parm)/sizeof(struct adapter_parm); | ||
127 | if (type < 0 || type >= type_count) { | ||
128 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); | 125 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); |
129 | type = 0; | 126 | type = 0; |
130 | } | 127 | } |
131 | 128 | ||
132 | if (base == 0) { | 129 | if (base == 0) { |
133 | printk(KERN_INFO "i2c-parport: using default base 0x%x\n", DEFAULT_BASE); | 130 | printk(KERN_INFO "i2c-parport: using default base 0x%x\n", DEFAULT_BASE); |
134 | base = DEFAULT_BASE; | 131 | base = DEFAULT_BASE; |
@@ -152,7 +149,7 @@ static int __init i2c_parport_init(void) | |||
152 | release_region(base, 3); | 149 | release_region(base, 3); |
153 | return -ENODEV; | 150 | return -ENODEV; |
154 | } | 151 | } |
155 | 152 | ||
156 | return 0; | 153 | return 0; |
157 | } | 154 | } |
158 | 155 | ||