Skip to content

Commit

Permalink
i2c-parport: Fix misplaced parport_release call
Browse files Browse the repository at this point in the history
We shouldn't release the parallel port until we are actually done with
it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Jean Delvare committed Nov 28, 2008
1 parent 79b93e1 commit 7b964f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ static void i2c_parport_attach (struct parport *port)
if (adapter_parm[type].init.val)
line_set(port, 1, &adapter_parm[type].init);

parport_release(adapter->pdev);

if (i2c_bit_add_bus(&adapter->adapter) < 0) {
printk(KERN_ERR "i2c-parport: Unable to register with I2C\n");
goto ERROR1;
Expand All @@ -202,6 +200,7 @@ static void i2c_parport_attach (struct parport *port)
return;

ERROR1:
parport_release(adapter->pdev);
parport_unregister_device(adapter->pdev);
ERROR0:
kfree(adapter);
Expand All @@ -221,6 +220,7 @@ static void i2c_parport_detach (struct parport *port)
if (adapter_parm[type].init.val)
line_set(port, 0, &adapter_parm[type].init);

parport_release(adapter->pdev);
parport_unregister_device(adapter->pdev);
if (prev)
prev->next = adapter->next;
Expand Down

0 comments on commit 7b964f7

Please sign in to comment.