ehci-s5p: Use device tree to get name of desired phy
authorKamil Debski <k.debski@samsung.com>
Thu, 26 Sep 2013 08:04:02 +0000 (10:04 +0200)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:44:51 +0000 (11:44 +0900)
With this patch the name of the phy that should be used is read from
the device tree. This gives more flexibility to use the driver without
recompiling.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
drivers/usb/host/ehci-s5p.c

index c0b3ebd..49ec64c 100644 (file)
@@ -196,6 +196,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
        struct usb_hcd *hcd;
        struct ehci_hcd *ehci;
        struct resource *res;
+       const char *phy_name;
        int irq;
        int err;
 
@@ -218,7 +219,8 @@ static int s5p_ehci_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
        s5p_ehci = to_s5p_ehci(hcd);
-       phy =  devm_phy_get(&pdev->dev, "hsic0");
+       phy_name = of_get_property(pdev->dev.of_node, "phy-names", NULL);
+       phy =  devm_phy_get(&pdev->dev, phy_name);
        if (IS_ERR(phy)) {
                /* Fallback to pdata */
                if (!pdata) {