mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
PCI: imx6: Move regulator enable out of imx6_pcie_deassert_core_reset()
Move regulator enable out of imx6_pcie_deassert_core_reset(), since the regulator_enable() has nothing to do with imx6_pcie_deassert_core_reset(). Link: https://lore.kernel.org/r/1657783869-19194-12-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
a4bb720eeb
commit
f0691e326b
@ -712,19 +712,10 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
|
||||
struct device *dev = pci->dev;
|
||||
int ret;
|
||||
|
||||
if (imx6_pcie->vpcie) {
|
||||
ret = regulator_enable(imx6_pcie->vpcie);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to enable vpcie regulator: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = imx6_pcie_clk_enable(imx6_pcie);
|
||||
if (ret) {
|
||||
dev_err(dev, "unable to enable pcie clocks: %d\n", ret);
|
||||
goto err_clks;
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (imx6_pcie->drvdata->variant) {
|
||||
@ -783,15 +774,6 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_clks:
|
||||
if (imx6_pcie->vpcie) {
|
||||
ret = regulator_disable(imx6_pcie->vpcie);
|
||||
if (ret)
|
||||
dev_err(dev, "failed to disable vpcie regulator: %d\n",
|
||||
ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int imx6_pcie_wait_for_speed_change(struct imx6_pcie *imx6_pcie)
|
||||
@ -914,17 +896,31 @@ static int imx6_pcie_host_init(struct dw_pcie_rp *pp)
|
||||
struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci);
|
||||
int ret;
|
||||
|
||||
if (imx6_pcie->vpcie) {
|
||||
ret = regulator_enable(imx6_pcie->vpcie);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to enable vpcie regulator: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
imx6_pcie_assert_core_reset(imx6_pcie);
|
||||
imx6_pcie_init_phy(imx6_pcie);
|
||||
ret = imx6_pcie_deassert_core_reset(imx6_pcie);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "pcie deassert core reset failed: %d\n", ret);
|
||||
return ret;
|
||||
goto err_reg_disable;
|
||||
}
|
||||
|
||||
imx6_setup_phy_mpll(imx6_pcie);
|
||||
|
||||
return 0;
|
||||
|
||||
err_reg_disable:
|
||||
if (imx6_pcie->vpcie)
|
||||
regulator_disable(imx6_pcie->vpcie);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct dw_pcie_host_ops imx6_pcie_host_ops = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user