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

usb: dwc3: exynos: Remove dead code

All supported Exynos variants provide respective generic PHY framework
based drivers for controlling USB PHYs, so there is no point
creating fake USB PHYs based on platform devices. While removing useless
code, remove calls to runtime PM, which have no effect.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Marek Szyprowski and committed by
Felipe Balbi
1e041b6f 4a13b968

-75
-75
drivers/usb/dwc3/dwc3-exynos.c
··· 13 13 #include <linux/slab.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/clk.h> 16 - #include <linux/usb/otg.h> 17 - #include <linux/usb/usb_phy_generic.h> 18 16 #include <linux/of.h> 19 17 #include <linux/of_platform.h> 20 18 #include <linux/regulator/consumer.h> 21 19 22 20 struct dwc3_exynos { 23 - struct platform_device *usb2_phy; 24 - struct platform_device *usb3_phy; 25 21 struct device *dev; 26 22 27 23 struct clk *clk; ··· 27 31 struct regulator *vdd33; 28 32 struct regulator *vdd10; 29 33 }; 30 - 31 - static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos) 32 - { 33 - struct usb_phy_generic_platform_data pdata; 34 - struct platform_device *pdev; 35 - int ret; 36 - 37 - memset(&pdata, 0x00, sizeof(pdata)); 38 - 39 - pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO); 40 - if (!pdev) 41 - return -ENOMEM; 42 - 43 - exynos->usb2_phy = pdev; 44 - pdata.type = USB_PHY_TYPE_USB2; 45 - pdata.gpio_reset = -1; 46 - 47 - ret = platform_device_add_data(exynos->usb2_phy, &pdata, sizeof(pdata)); 48 - if (ret) 49 - goto err1; 50 - 51 - pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO); 52 - if (!pdev) { 53 - ret = -ENOMEM; 54 - goto err1; 55 - } 56 - 57 - exynos->usb3_phy = pdev; 58 - pdata.type = USB_PHY_TYPE_USB3; 59 - 60 - ret = platform_device_add_data(exynos->usb3_phy, &pdata, sizeof(pdata)); 61 - if (ret) 62 - goto err2; 63 - 64 - ret = platform_device_add(exynos->usb2_phy); 65 - if (ret) 66 - goto err2; 67 - 68 - ret = platform_device_add(exynos->usb3_phy); 69 - if (ret) 70 - goto err3; 71 - 72 - return 0; 73 - 74 - err3: 75 - platform_device_del(exynos->usb2_phy); 76 - 77 - err2: 78 - platform_device_put(exynos->usb3_phy); 79 - 80 - err1: 81 - platform_device_put(exynos->usb2_phy); 82 - 83 - return ret; 84 - } 85 34 86 35 static int dwc3_exynos_remove_child(struct device *dev, void *unused) 87 36 { ··· 105 164 goto vdd10_err; 106 165 } 107 166 108 - ret = dwc3_exynos_register_phys(exynos); 109 - if (ret) { 110 - dev_err(dev, "couldn't register PHYs\n"); 111 - goto phys_err; 112 - } 113 - 114 167 if (node) { 115 168 ret = of_platform_populate(node, NULL, NULL, dev); 116 169 if (ret) { ··· 120 185 return 0; 121 186 122 187 populate_err: 123 - platform_device_unregister(exynos->usb2_phy); 124 - platform_device_unregister(exynos->usb3_phy); 125 - phys_err: 126 188 regulator_disable(exynos->vdd10); 127 189 vdd10_err: 128 190 regulator_disable(exynos->vdd33); ··· 137 205 struct dwc3_exynos *exynos = platform_get_drvdata(pdev); 138 206 139 207 device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); 140 - platform_device_unregister(exynos->usb2_phy); 141 - platform_device_unregister(exynos->usb3_phy); 142 208 143 209 clk_disable_unprepare(exynos->axius_clk); 144 210 clk_disable_unprepare(exynos->susp_clk); ··· 187 257 188 258 clk_enable(exynos->clk); 189 259 clk_enable(exynos->axius_clk); 190 - 191 - /* runtime set active to reflect active state. */ 192 - pm_runtime_disable(dev); 193 - pm_runtime_set_active(dev); 194 - pm_runtime_enable(dev); 195 260 196 261 return 0; 197 262 }