Commit 90aa2997 authored by Andrew Lunn's avatar Andrew Lunn Committed by Jason Cooper

ata: sata_mv: Fix probe failures with optional phys

Make use of devm_phy_optional_get() in order to fix probe failures on
Armada 370, XP and others, when there is no phy driver available.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Tested-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent 788a4d56
......@@ -4126,12 +4126,14 @@ static int mv_platform_probe(struct platform_device *pdev)
clk_prepare_enable(hpriv->port_clks[port]);
sprintf(port_number, "port%d", port);
hpriv->port_phys[port] = devm_phy_get(&pdev->dev, port_number);
hpriv->port_phys[port] = devm_phy_optional_get(&pdev->dev,
port_number);
if (IS_ERR(hpriv->port_phys[port])) {
rc = PTR_ERR(hpriv->port_phys[port]);
hpriv->port_phys[port] = NULL;
if ((rc != -EPROBE_DEFER) && (rc != -ENODEV))
dev_warn(&pdev->dev, "error getting phy");
if (rc != -EPROBE_DEFER)
dev_warn(&pdev->dev, "error getting phy %d",
rc);
goto err;
} else
phy_power_on(hpriv->port_phys[port]);
......
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