static int mx6q_sabrelite_sata_init(struct device *dev, void __iomem *addr)
{
u32 tmpdata;
- int ret = 0, iterations = 20;
+ int ret = 0;
struct clk *clk;
sata_clk = clk_get(dev, "imx_sata_clk");
tmpdata = clk_get_rate(clk) / 1000;
clk_put(clk);
- sata_init(addr, tmpdata);
-
- /* Release resources when there is no device on the port */
- do {
- if ((readl(addr + PORT_SATA_SR) & 0xF) == 0)
- msleep(25);
- else
- break;
-
- if (iterations == 0) {
- dev_info(dev, "NO sata disk.\n");
- ret = -ENODEV;
- goto release_sata_clk;
- }
- } while (iterations-- > 0);
-
- return ret;
+ ret = sata_init(addr, tmpdata);
+ if (ret == 0)
+ return ret;
release_sata_clk:
clk_disable(sata_clk);