[PATCH] PCI: mediatek-gen3: Check the return value of the reset_control_bulk_deassert

Qianqiang Liu qianqiang.liu at 163.com
Wed Sep 11 07:31:55 PDT 2024


"reset_control_bulk_deassert" may return error code, we should check the
return value of it.

Signed-off-by: Qianqiang Liu <qianqiang.liu at 163.com>
---
 drivers/pci/controller/pcie-mediatek-gen3.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index 66ce4b5d309b..5b35dc32ad47 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -1016,7 +1016,9 @@ static int mtk_pcie_setup(struct mtk_gen3_pcie *pcie)
 	 * Deassert the line in order to avoid unbalance in deassert_count
 	 * counter since the bulk is shared.
 	 */
-	reset_control_bulk_deassert(pcie->soc->phy_resets.num_resets, pcie->phy_resets);
+	err = reset_control_bulk_deassert(pcie->soc->phy_resets.num_resets, pcie->phy_resets);
+	if (err)
+		return err;
 	/*
 	 * The controller may have been left out of reset by the bootloader
 	 * so make sure that we get a clean start by asserting resets here.
-- 
2.39.2




More information about the Linux-mediatek mailing list