PCI: imx6: Move imx6_pcie_clk_disable() earlier
authorRichard Zhu <hongxing.zhu@nxp.com>
Thu, 14 Jul 2022 07:30:56 +0000 (15:30 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 1 Aug 2022 20:33:21 +0000 (15:33 -0500)
Move imx6_pcie_clk_disable() earlier to be near other clock-related
functions.  No functional change intended.

[bhelgaas: reorder patch so pure moves are earlier]
Link: https://lore.kernel.org/r/1657783869-19194-5-git-send-email-hongxing.zhu@nxp.com
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
drivers/pci/controller/dwc/pci-imx6.c

index c061697..09cf496 100644 (file)
@@ -580,6 +580,30 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
        return ret;
 }
 
+static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie)
+{
+       clk_disable_unprepare(imx6_pcie->pcie);
+       clk_disable_unprepare(imx6_pcie->pcie_phy);
+       clk_disable_unprepare(imx6_pcie->pcie_bus);
+
+       switch (imx6_pcie->drvdata->variant) {
+       case IMX6SX:
+               clk_disable_unprepare(imx6_pcie->pcie_inbound_axi);
+               break;
+       case IMX7D:
+               regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
+                                  IMX7D_GPR12_PCIE_PHY_REFCLK_SEL,
+                                  IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
+               break;
+       case IMX8MQ:
+       case IMX8MM:
+               clk_disable_unprepare(imx6_pcie->pcie_aux);
+               break;
+       default:
+               break;
+       }
+}
+
 static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
 {
        struct device *dev = imx6_pcie->pci->dev;
@@ -940,30 +964,6 @@ pm_turnoff_sleep:
        usleep_range(1000, 10000);
 }
 
-static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie)
-{
-       clk_disable_unprepare(imx6_pcie->pcie);
-       clk_disable_unprepare(imx6_pcie->pcie_phy);
-       clk_disable_unprepare(imx6_pcie->pcie_bus);
-
-       switch (imx6_pcie->drvdata->variant) {
-       case IMX6SX:
-               clk_disable_unprepare(imx6_pcie->pcie_inbound_axi);
-               break;
-       case IMX7D:
-               regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
-                                  IMX7D_GPR12_PCIE_PHY_REFCLK_SEL,
-                                  IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
-               break;
-       case IMX8MQ:
-       case IMX8MM:
-               clk_disable_unprepare(imx6_pcie->pcie_aux);
-               break;
-       default:
-               break;
-       }
-}
-
 static int imx6_pcie_suspend_noirq(struct device *dev)
 {
        struct imx6_pcie *imx6_pcie = dev_get_drvdata(dev);