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>
This commit is contained in:
parent
79b93e1359
commit
7b964f7337
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue