@@ -75,6 +75,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
struct ata_taskfile tf;
bool online;
+ bool ls101021a_workaround = (qoriq_priv->type == AHCI_LS1021A);
int rc;
DPRINTK("ENTER\n");
@@ -92,7 +93,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
* After the sequence is complete, software should restore the
* PxCMD and PxIS with the stored values.
*/
- if (qoriq_priv->type == AHCI_LS1021A) {
+ if (ls101021a_workaround) {
px_cmd = readl(port_mmio + PORT_CMD);
px_is = readl(port_mmio + PORT_IRQ_STAT);
}
@@ -106,7 +107,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
ahci_check_ready);
/* restore the PxCMD and PxIS on ls1021 */
- if (qoriq_priv->type == AHCI_LS1021A) {
+ if (ls101021a_workaround) {
px_val = readl(port_mmio + PORT_CMD);
if (px_val != px_cmd)
writel(px_cmd, port_mmio + PORT_CMD);