Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "usb: ehci/ohci-exynos: Fix PHY getting sequence"

This reverts commit 039368901ad0a6476c7ecf0cfe4f84d735e30135.

Vivek writes:
We not longer need this patch, since we have planned to remove
the usb-phy drivers for samsung [1], we have completely deleted
the support for the the same from ohci-exynos and ehci-exynos
drivers too [2]. Sorry for the confusion, but this patch can be
dropped and instead we can pick the patches in [2].

[1] http://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg35774.html
[2] https://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg35695.html
https://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg35696.html

Cc: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+45 -42
+20 -20
drivers/usb/host/ehci-exynos.c
··· 62 62 int phy_number; 63 63 int ret = 0; 64 64 65 + exynos_ehci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); 66 + if (IS_ERR(exynos_ehci->phy)) { 67 + ret = PTR_ERR(exynos_ehci->phy); 68 + if (ret != -ENXIO && ret != -ENODEV) { 69 + dev_err(dev, "no usb2 phy configured\n"); 70 + return ret; 71 + } 72 + dev_dbg(dev, "Failed to get usb2 phy\n"); 73 + } else { 74 + exynos_ehci->otg = exynos_ehci->phy->otg; 75 + } 76 + 65 77 for_each_available_child_of_node(dev->of_node, child) { 66 78 ret = of_property_read_u32(child, "reg", &phy_number); 67 79 if (ret) { ··· 90 78 91 79 phy = devm_of_phy_get(dev, child, NULL); 92 80 of_node_put(child); 93 - if (IS_ERR(phy)) 94 - /* Lets fallback to older USB-PHYs */ 95 - goto usb_phy_old; 96 - exynos_ehci->phy_g[phy_number] = phy; 97 - /* Make the older PHYs unavailable */ 98 - exynos_ehci->phy = ERR_PTR(-ENXIO); 99 - } 100 - 101 - return 0; 102 - 103 - usb_phy_old: 104 - exynos_ehci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); 105 - if (IS_ERR(exynos_ehci->phy)) { 106 - ret = PTR_ERR(exynos_ehci->phy); 107 - if (ret != -ENXIO && ret != -ENODEV) { 108 - dev_err(dev, "no usb2 phy configured\n"); 109 - return ret; 81 + if (IS_ERR(phy)) { 82 + ret = PTR_ERR(phy); 83 + if (ret != -ENOSYS && ret != -ENODEV) { 84 + dev_err(dev, "no usb2 phy configured\n"); 85 + return ret; 86 + } 87 + dev_dbg(dev, "Failed to get usb2 phy\n"); 110 88 } 111 - dev_dbg(dev, "Failed to get usb2 phy\n"); 112 - } else { 113 - exynos_ehci->otg = exynos_ehci->phy->otg; 89 + exynos_ehci->phy_g[phy_number] = phy; 114 90 } 115 91 116 92 return ret;
+25 -22
drivers/usb/host/ohci-exynos.c
··· 51 51 int phy_number; 52 52 int ret = 0; 53 53 54 + exynos_ohci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); 55 + if (IS_ERR(exynos_ohci->phy)) { 56 + ret = PTR_ERR(exynos_ohci->phy); 57 + if (ret != -ENXIO && ret != -ENODEV) { 58 + dev_err(dev, "no usb2 phy configured\n"); 59 + return ret; 60 + } 61 + dev_dbg(dev, "Failed to get usb2 phy\n"); 62 + } else { 63 + exynos_ohci->otg = exynos_ohci->phy->otg; 64 + } 65 + 54 66 /* 55 67 * Getting generic phy: 56 68 * We are keeping both types of phys as a part of transiting OHCI 57 69 * to generic phy framework, so as to maintain backward compatibilty 58 - * with old DTB too. 59 - * We fallback to older USB-PHYs when we fail to get generic PHYs. 70 + * with old DTB. 71 + * If there are existing devices using DTB files built from them, 72 + * to remove the support for old bindings in this driver, 73 + * we need to make sure that such devices have their DTBs 74 + * updated to ones built from new DTS. 60 75 */ 61 76 for_each_available_child_of_node(dev->of_node, child) { 62 77 ret = of_property_read_u32(child, "reg", &phy_number); ··· 89 74 90 75 phy = devm_of_phy_get(dev, child, NULL); 91 76 of_node_put(child); 92 - if (IS_ERR(phy)) 93 - /* Lets fallback to older USB-PHYs */ 94 - goto usb_phy_old; 95 - exynos_ohci->phy_g[phy_number] = phy; 96 - /* Make the older PHYs unavailable */ 97 - exynos_ohci->phy = ERR_PTR(-ENXIO); 98 - } 99 - 100 - return 0; 101 - 102 - usb_phy_old: 103 - exynos_ohci->phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); 104 - if (IS_ERR(exynos_ohci->phy)) { 105 - ret = PTR_ERR(exynos_ohci->phy); 106 - if (ret != -ENXIO && ret != -ENODEV) { 107 - dev_err(dev, "no usb2 phy configured\n"); 108 - return ret; 77 + if (IS_ERR(phy)) { 78 + ret = PTR_ERR(phy); 79 + if (ret != -ENOSYS && ret != -ENODEV) { 80 + dev_err(dev, "no usb2 phy configured\n"); 81 + return ret; 82 + } 83 + dev_dbg(dev, "Failed to get usb2 phy\n"); 109 84 } 110 - dev_dbg(dev, "Failed to get usb2 phy\n"); 111 - } else { 112 - exynos_ohci->otg = exynos_ohci->phy->otg; 85 + exynos_ohci->phy_g[phy_number] = phy; 113 86 } 114 87 115 88 return ret;