Commit 083ad04d authored by Ondrej Zary's avatar Ondrej Zary Committed by Damien Le Moal

ata: pata_parport-bpck6: reduce indents in bpck6_open

Reverse error handling conditions to reduce code indents in bpck6_open.
Signed-off-by: default avatarOndrej Zary <linux@zary.sk>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 49745f62
...@@ -318,30 +318,32 @@ static int bpck6_open(struct pi_adapter *pi) ...@@ -318,30 +318,32 @@ static int bpck6_open(struct pi_adapter *pi)
j = ((i & 0x08) << 4) | ((i & 0x07) << 3); j = ((i & 0x08) << 4) | ((i & 0x07) << 3);
k = parport_read_status(pi->pardev->port) & 0xB8; k = parport_read_status(pi->pardev->port) & 0xB8;
if (j == k) { if (j != k)
parport_frob_control(pi->pardev->port, PARPORT_CONTROL_AUTOFD, 0); goto fail;
k = (parport_read_status(pi->pardev->port) & 0xB8) ^ 0xB8;
if (j == k) { parport_frob_control(pi->pardev->port, PARPORT_CONTROL_AUTOFD, 0);
if (i & 4) // EPP k = (parport_read_status(pi->pardev->port) & 0xB8) ^ 0xB8;
parport_frob_control(pi->pardev->port, if (j != k)
PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, 0); goto fail;
else // PPC/ECP
parport_frob_control(pi->pardev->port, if (i & 4) // EPP
PARPORT_CONTROL_SELECT, 0); parport_frob_control(pi->pardev->port,
PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, 0);
pi->private = 0; else // PPC/ECP
parport_frob_control(pi->pardev->port, PARPORT_CONTROL_SELECT, 0);
bpck6_send_cmd(pi, ACCESS_REG | ACCESS_WRITE | REG_RAMSIZE);
bpck6_wr_data_byte(pi, RAMSIZE_128K); pi->private = 0;
bpck6_send_cmd(pi, ACCESS_REG | ACCESS_READ | REG_VERSION); bpck6_send_cmd(pi, ACCESS_REG | ACCESS_WRITE | REG_RAMSIZE);
if ((bpck6_rd_data_byte(pi) & 0x3F) == 0x0C) bpck6_wr_data_byte(pi, RAMSIZE_128K);
pi->private |= fifo_wait;
bpck6_send_cmd(pi, ACCESS_REG | ACCESS_READ | REG_VERSION);
return 1; if ((bpck6_rd_data_byte(pi) & 0x3F) == 0x0C)
} pi->private |= fifo_wait;
}
return 1;
fail:
parport_write_control(pi->pardev->port, pi->saved_r2); parport_write_control(pi->pardev->port, pi->saved_r2);
parport_write_data(pi->pardev->port, pi->saved_r0); parport_write_data(pi->pardev->port, pi->saved_r0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment