aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 52b8181ddafd..05c8a44adf8e 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -4104,7 +4104,6 @@ static int mv_platform_probe(struct platform_device *pdev)
4104 if (!hpriv->port_phys) 4104 if (!hpriv->port_phys)
4105 return -ENOMEM; 4105 return -ENOMEM;
4106 host->private_data = hpriv; 4106 host->private_data = hpriv;
4107 hpriv->n_ports = n_ports;
4108 hpriv->board_idx = chip_soc; 4107 hpriv->board_idx = chip_soc;
4109 4108
4110 host->iomap = NULL; 4109 host->iomap = NULL;
@@ -4132,13 +4131,18 @@ static int mv_platform_probe(struct platform_device *pdev)
4132 rc = PTR_ERR(hpriv->port_phys[port]); 4131 rc = PTR_ERR(hpriv->port_phys[port]);
4133 hpriv->port_phys[port] = NULL; 4132 hpriv->port_phys[port] = NULL;
4134 if (rc != -EPROBE_DEFER) 4133 if (rc != -EPROBE_DEFER)
4135 dev_warn(&pdev->dev, "error getting phy %d", 4134 dev_warn(&pdev->dev, "error getting phy %d", rc);
4136 rc); 4135
4136 /* Cleanup only the initialized ports */
4137 hpriv->n_ports = port;
4137 goto err; 4138 goto err;
4138 } else 4139 } else
4139 phy_power_on(hpriv->port_phys[port]); 4140 phy_power_on(hpriv->port_phys[port]);
4140 } 4141 }
4141 4142
4143 /* All the ports have been initialized */
4144 hpriv->n_ports = n_ports;
4145
4142 /* 4146 /*
4143 * (Re-)program MBUS remapping windows if we are asked to. 4147 * (Re-)program MBUS remapping windows if we are asked to.
4144 */ 4148 */
@@ -4176,7 +4180,7 @@ err:
4176 clk_disable_unprepare(hpriv->clk); 4180 clk_disable_unprepare(hpriv->clk);
4177 clk_put(hpriv->clk); 4181 clk_put(hpriv->clk);
4178 } 4182 }
4179 for (port = 0; port < n_ports; port++) { 4183 for (port = 0; port < hpriv->n_ports; port++) {
4180 if (!IS_ERR(hpriv->port_clks[port])) { 4184 if (!IS_ERR(hpriv->port_clks[port])) {
4181 clk_disable_unprepare(hpriv->port_clks[port]); 4185 clk_disable_unprepare(hpriv->port_clks[port]);
4182 clk_put(hpriv->port_clks[port]); 4186 clk_put(hpriv->port_clks[port]);