FROMLIST: phy: rockchip-typec: add pm_runtime_disable in err case
authorChris Zhong <zyw@rock-chips.com>
Thu, 8 Sep 2016 17:38:11 +0000 (10:38 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 8 Nov 2016 07:58:36 +0000 (15:58 +0800)
Add pm_runtime_disable in err case to make the pm_runtime_enable/disable
is invoked balanced.

BUG=chrome-os-partner:52872
TEST=Check DP display and USB3

Change-Id: Ifc66a3e80d7b580963e609d2f14cea239104724c
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9321849/)
Reviewed-on: https://chromium-review.googlesource.com/382723
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: William Wu <wulf@rock-chips.com>
drivers/phy/phy-rockchip-typec.c

index 3f747ff094e80affba30c5c058ddd5e6b40f2b5a..26274654cf264b7e1e267880723c966cd02a1be8 100644 (file)
@@ -1015,6 +1015,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
                if (IS_ERR(phy)) {
                        dev_err(dev, "failed to create phy: %s\n",
                                child_np->name);
+                       pm_runtime_disable(dev);
                        return PTR_ERR(phy);
                }
 
@@ -1024,6 +1025,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
        phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
        if (IS_ERR(phy_provider)) {
                dev_err(dev, "Failed to register phy provider\n");
+               pm_runtime_disable(dev);
                return PTR_ERR(phy_provider);
        }