usb: dwc3: exynos: Remove dead code
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 17 Sep 2018 07:26:51 +0000 (09:26 +0200)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:58:00 +0000 (14:58 +0900)
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>
Change-Id: I2c82d23cfe1daeea1b3b93f1f87de5757f17e451

drivers/usb/dwc3/dwc3-exynos.c

index e089df72f766eece45c73ef652c7dfe2aab6da5e..1b71485c3f4a71aea9cee13b3d61bfc957a205e3 100644 (file)
 #include <linux/slab.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
-#include <linux/usb/otg.h>
-#include <linux/usb/usb_phy_generic.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/regulator/consumer.h>
 
 struct dwc3_exynos {
-       struct platform_device  *usb2_phy;
-       struct platform_device  *usb3_phy;
        struct device           *dev;
 
        struct clk              *clk;
@@ -40,61 +36,6 @@ struct dwc3_exynos {
        struct regulator        *vdd10;
 };
 
-static int dwc3_exynos_register_phys(struct dwc3_exynos *exynos)
-{
-       struct usb_phy_generic_platform_data pdata;
-       struct platform_device  *pdev;
-       int                     ret;
-
-       memset(&pdata, 0x00, sizeof(pdata));
-
-       pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
-       if (!pdev)
-               return -ENOMEM;
-
-       exynos->usb2_phy = pdev;
-       pdata.type = USB_PHY_TYPE_USB2;
-       pdata.gpio_reset = -1;
-
-       ret = platform_device_add_data(exynos->usb2_phy, &pdata, sizeof(pdata));
-       if (ret)
-               goto err1;
-
-       pdev = platform_device_alloc("usb_phy_generic", PLATFORM_DEVID_AUTO);
-       if (!pdev) {
-               ret = -ENOMEM;
-               goto err1;
-       }
-
-       exynos->usb3_phy = pdev;
-       pdata.type = USB_PHY_TYPE_USB3;
-
-       ret = platform_device_add_data(exynos->usb3_phy, &pdata, sizeof(pdata));
-       if (ret)
-               goto err2;
-
-       ret = platform_device_add(exynos->usb2_phy);
-       if (ret)
-               goto err2;
-
-       ret = platform_device_add(exynos->usb3_phy);
-       if (ret)
-               goto err3;
-
-       return 0;
-
-err3:
-       platform_device_del(exynos->usb2_phy);
-
-err2:
-       platform_device_put(exynos->usb3_phy);
-
-err1:
-       platform_device_put(exynos->usb2_phy);
-
-       return ret;
-}
-
 static int dwc3_exynos_remove_child(struct device *dev, void *unused)
 {
        struct platform_device *pdev = to_platform_device(dev);
@@ -172,12 +113,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
                goto vdd10_err;
        }
 
-       ret = dwc3_exynos_register_phys(exynos);
-       if (ret) {
-               dev_err(dev, "couldn't register PHYs\n");
-               goto phys_err;
-       }
-
        if (node) {
                ret = of_platform_populate(node, NULL, NULL, dev);
                if (ret) {
@@ -193,9 +128,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
        return 0;
 
 populate_err:
-       platform_device_unregister(exynos->usb2_phy);
-       platform_device_unregister(exynos->usb3_phy);
-phys_err:
        regulator_disable(exynos->vdd10);
 vdd10_err:
        regulator_disable(exynos->vdd33);
@@ -213,8 +145,6 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
        struct dwc3_exynos      *exynos = platform_get_drvdata(pdev);
 
        device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);
-       platform_device_unregister(exynos->usb2_phy);
-       platform_device_unregister(exynos->usb3_phy);
 
        clk_disable_unprepare(exynos->axius_clk);
        clk_disable_unprepare(exynos->susp_clk);
@@ -266,11 +196,6 @@ static int dwc3_exynos_resume(struct device *dev)
        clk_enable(exynos->clk);
        clk_enable(exynos->axius_clk);
 
-       /* runtime set active to reflect active state. */
-       pm_runtime_disable(dev);
-       pm_runtime_set_active(dev);
-       pm_runtime_enable(dev);
-
        return 0;
 }