mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
ata: pata_parport-bpck6: reduce indents in bpck6_open
Reverse error handling conditions to reduce code indents in bpck6_open. Signed-off-by: Ondrej Zary <linux@zary.sk> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
This commit is contained in:
parent
49745f621a
commit
083ad04d31
1 changed files with 21 additions and 19 deletions
|
@ -318,16 +318,19 @@ static int bpck6_open(struct pi_adapter *pi)
|
|||
|
||||
j = ((i & 0x08) << 4) | ((i & 0x07) << 3);
|
||||
k = parport_read_status(pi->pardev->port) & 0xB8;
|
||||
if (j == k) {
|
||||
if (j != k)
|
||||
goto fail;
|
||||
|
||||
parport_frob_control(pi->pardev->port, PARPORT_CONTROL_AUTOFD, 0);
|
||||
k = (parport_read_status(pi->pardev->port) & 0xB8) ^ 0xB8;
|
||||
if (j == k) {
|
||||
if (j != k)
|
||||
goto fail;
|
||||
|
||||
if (i & 4) // EPP
|
||||
parport_frob_control(pi->pardev->port,
|
||||
PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, 0);
|
||||
else // PPC/ECP
|
||||
parport_frob_control(pi->pardev->port,
|
||||
PARPORT_CONTROL_SELECT, 0);
|
||||
parport_frob_control(pi->pardev->port, PARPORT_CONTROL_SELECT, 0);
|
||||
|
||||
pi->private = 0;
|
||||
|
||||
|
@ -339,9 +342,8 @@ static int bpck6_open(struct pi_adapter *pi)
|
|||
pi->private |= fifo_wait;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
fail:
|
||||
parport_write_control(pi->pardev->port, pi->saved_r2);
|
||||
parport_write_data(pi->pardev->port, pi->saved_r0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue