PCI: rockchip: Disable vpcie0v9 if resume_noirq fails
authorJeffy Chen <jeffy.chen@rock-chips.com>
Wed, 23 Aug 2017 07:03:17 +0000 (15:03 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Aug 2017 18:18:08 +0000 (13:18 -0500)
Disable vpcie0v9 regulator if resume_noirq fails.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pcie-rockchip.c

index 7d7c69ac12611209b978d8fd48b8389d734f5bad..ac8b8e8270f7150fcf7c8744f3af23b05f4fd9a6 100644 (file)
@@ -1488,7 +1488,7 @@ static int __maybe_unused rockchip_pcie_resume_noirq(struct device *dev)
 
        err = rockchip_pcie_enable_clocks(rockchip);
        if (err)
-               return err;
+               goto err_disable_0v9;
 
        err = rockchip_pcie_init_port(rockchip);
        if (err)
@@ -1508,6 +1508,9 @@ err_err_deinit_port:
        rockchip_pcie_deinit_phys(rockchip);
 err_pcie_resume:
        rockchip_pcie_disable_clocks(rockchip);
+err_disable_0v9:
+       if (!IS_ERR(rockchip->vpcie0v9))
+               regulator_disable(rockchip->vpcie0v9);
        return err;
 }