diff options
-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; |