Skip to contentSkip to conversation

PCI: imx6: Change imx_pcie_deassert_core_reset() to return void

PATCH Applied Sherry Sun 3 participants 3 messages Mar 6 – Mar 26

Subsystems (4)
lore
Share & tools
lore

Sherry Sun

author
#0 lore raw

PATCH v2 1/1 PCI: imx6: Change imx_pcie_deassert_core_reset() to return void

The function imx_pcie_deassert_core_reset() always returns 0 and the return value is not used meaningfully by its callers.

Change the return type from int to void to simplify the code and remove unnecessary error handling paths. No functional change intended.

---
Changes in V2:
1. Remove the Fixes tag.
2. Add Reviewed-by tag.

---
 drivers/pci/controller/dwc/pci-imx6.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +3 -11
index 81a7093494c8..ba6e7c7ee625 100644
@@ -906,7 +906,7 @@ static void imx_pcie_assert_core_reset(struct imx_pcie *imx_pcie)
 	gpiod_set_value_cansleep(imx_pcie->reset_gpiod, 1);
 }
 
-static int imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie)
+static void imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie)
 {
 	reset_control_deassert(imx_pcie->pciephy_reset);
 
@@ -920,8 +920,6 @@ static int imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie)
 		/* Wait for 100ms after PERST# deassertion (PCIe r5.0, 6.6.1) */
 		msleep(100);
 	}
-
-	return 0;
 }
 
 static int imx_pcie_wait_for_speed_change(struct imx_pcie *imx_pcie)
@@ -1292,11 +1290,7 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
 	/* Make sure that PCIe LTSSM is cleared */
 	imx_pcie_ltssm_disable(dev);
 
-	ret = imx_pcie_deassert_core_reset(imx_pcie);
-	if (ret < 0) {
-		dev_err(dev, "pcie deassert core reset failed: %d\n", ret);
-		goto err_phy_off;
-	}
+	imx_pcie_deassert_core_reset(imx_pcie);
 
 	if (imx_pcie->drvdata->wait_pll_lock) {
 		ret = imx_pcie->drvdata->wait_pll_lock(imx_pcie);
@@ -1613,9 +1607,7 @@ static int imx_pcie_resume_noirq(struct device *dev)
 		ret = imx_pcie->drvdata->enable_ref_clk(imx_pcie, true);
 		if (ret)
 			return ret;
-		ret = imx_pcie_deassert_core_reset(imx_pcie);
-		if (ret)
-			return ret;
+		imx_pcie_deassert_core_reset(imx_pcie);
 
 		/*
 		 * Using PCIE_TEST_PD seems to disable MSI and powers down the
Signature · 1 line
2.37.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Sherry Sun <[email protected]>
Sent: 2026年3月6日 10:13
To: Hongxing Zhu <[email protected]>; [email protected]; Frank Li <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH V2] PCI: imx6: Change imx_pcie_deassert_core_reset() to return void

Quoted 8 lines

The function imx_pcie_deassert_core_reset() always returns 0 and the return value is not used meaningfully by its callers.

Change the return type from int to void to simplify the code and remove unnecessary error handling paths. No functional change intended.

Best Regards
Richard Zhu

Quoted 59 lines

---
Changes in V2:
1. Remove the Fixes tag.
2. Add Reviewed-by tag.

---
 drivers/pci/controller/dwc/pci-imx6.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +1 -3
index 81a7093494c8..ba6e7c7ee625 100644
@@ -906,7 +906,7 @@ static void imx_pcie_assert_core_reset(struct
 imx_pcie *imx_pcie)
 	gpiod_set_value_cansleep(imx_pcie->reset_gpiod, 1);  }
 
-static int imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie)
+static void imx_pcie_deassert_core_reset(struct imx_pcie *imx_pcie)
 {
 	reset_control_deassert(imx_pcie->pciephy_reset);
 
@@ -920,8 +920,6 @@ static int imx_pcie_deassert_core_reset(struct
 imx_pcie *imx_pcie)
 		/* Wait for 100ms after PERST# deassertion (PCIe r5.0, 6.6.1) */
 		msleep(100);
 	}
-
-	return 0;
 }
 

static int imx_pcie_wait_for_speed_change(struct imx_pcie *imx_pcie) @@
-1292,11 +1290,7 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)

drivers/pci/controller/dwc/pci-imx6.c +2 -8
 	/* Make sure that PCIe LTSSM is cleared */
 	imx_pcie_ltssm_disable(dev);
 
-	ret = imx_pcie_deassert_core_reset(imx_pcie);
-	if (ret < 0) {
-		dev_err(dev, "pcie deassert core reset failed: %d\n", ret);
-		goto err_phy_off;
-	}
+	imx_pcie_deassert_core_reset(imx_pcie);
 
 	if (imx_pcie->drvdata->wait_pll_lock) {
 		ret = imx_pcie->drvdata->wait_pll_lock(imx_pcie);
@@ -1613,9 +1607,7 @@ static int imx_pcie_resume_noirq(struct device
 *dev)
 		ret = imx_pcie->drvdata->enable_ref_clk(imx_pcie, true);
 		if (ret)
 			return ret;
-		ret = imx_pcie_deassert_core_reset(imx_pcie);
-		if (ret)
-			return ret;
+		imx_pcie_deassert_core_reset(imx_pcie);
 
 		/*

* Using PCIE_TEST_PD seems to disable MSI and powers down the
--
2.37.1

#2 lore raw
In reply to Sherry Sun
Quoted 8 lines · Sherry Sun

The function imx_pcie_deassert_core_reset() always returns 0 and the return value is not used meaningfully by its callers.

Change the return type from int to void to simplify the code and remove unnecessary error handling paths. No functional change intended.

[...]

Applied, thanks!

[1/1] PCI: imx6: Change imx_pcie_deassert_core_reset() to return void

      commit: 192b8a1bf81c17852b6cf540c95b0a3bcc9c58c4

Best regards,

Signature · 1 line
Manivannan Sadhasivam <[email protected]>