usb: chipidea: fix phy handling
authorAntoine Tenart <antoine.tenart@free-electrons.com>
Wed, 26 Nov 2014 05:44:35 +0000 (13:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2014 17:28:12 +0000 (09:28 -0800)
The generic plaftorm device for ChipIdea drivers is probed by calling
ci_hdrc_probe. The device structure used is not the one of the specific
ChipIdea driver but the one of the generic ChipIdea platform device.

This results in not being able to probe the PHYs as we're not using the
right device structure. Since all ChipIdea drivers are retrieving their
PHYs in their specific driver code, this didn't impact any of them yet.

Fixes it using the right device structure (dev->parent).

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/core.c

index de1e4a8..068e0c6 100644 (file)
@@ -686,8 +686,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
        } else if (ci->platdata->usb_phy) {
                ci->usb_phy = ci->platdata->usb_phy;
        } else {
-               ci->phy = devm_phy_get(dev, "usb-phy");
-               ci->usb_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
+               ci->phy = devm_phy_get(dev->parent, "usb-phy");
+               ci->usb_phy = devm_usb_get_phy(dev->parent, USB_PHY_TYPE_USB2);
 
                /* if both generic PHY and USB PHY layers aren't enabled */
                if (PTR_ERR(ci->phy) == -ENOSYS &&