diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-11-28 09:24:39 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2008-11-28 09:24:39 -0500 |
commit | 7b964f733798960c899dc40911329aee7bee25e4 (patch) | |
tree | eb971e0bdcaddc580874d47048c24ce3bbe10d18 /drivers/i2c/busses/i2c-parport.c | |
parent | 79b93e1359b1414b438f239c6e5e0ad91232e4c8 (diff) |
i2c-parport: Fix misplaced parport_release call
We shouldn't release the parallel port until we are actually done with
it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-parport.c')
-rw-r--r-- | drivers/i2c/busses/i2c-parport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 59ba2086d2f9..a257cd5cd134 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -189,8 +189,6 @@ static void i2c_parport_attach (struct parport *port) | |||
189 | if (adapter_parm[type].init.val) | 189 | if (adapter_parm[type].init.val) |
190 | line_set(port, 1, &adapter_parm[type].init); | 190 | line_set(port, 1, &adapter_parm[type].init); |
191 | 191 | ||
192 | parport_release(adapter->pdev); | ||
193 | |||
194 | if (i2c_bit_add_bus(&adapter->adapter) < 0) { | 192 | if (i2c_bit_add_bus(&adapter->adapter) < 0) { |
195 | printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); | 193 | printk(KERN_ERR "i2c-parport: Unable to register with I2C\n"); |
196 | goto ERROR1; | 194 | goto ERROR1; |
@@ -202,6 +200,7 @@ static void i2c_parport_attach (struct parport *port) | |||
202 | return; | 200 | return; |
203 | 201 | ||
204 | ERROR1: | 202 | ERROR1: |
203 | parport_release(adapter->pdev); | ||
205 | parport_unregister_device(adapter->pdev); | 204 | parport_unregister_device(adapter->pdev); |
206 | ERROR0: | 205 | ERROR0: |
207 | kfree(adapter); | 206 | kfree(adapter); |
@@ -221,6 +220,7 @@ static void i2c_parport_detach (struct parport *port) | |||
221 | if (adapter_parm[type].init.val) | 220 | if (adapter_parm[type].init.val) |
222 | line_set(port, 0, &adapter_parm[type].init); | 221 | line_set(port, 0, &adapter_parm[type].init); |
223 | 222 | ||
223 | parport_release(adapter->pdev); | ||
224 | parport_unregister_device(adapter->pdev); | 224 | parport_unregister_device(adapter->pdev); |
225 | if (prev) | 225 | if (prev) |
226 | prev->next = adapter->next; | 226 | prev->next = adapter->next; |