[PATCH v2 1/2] PCI: tegra194: Use dev_err_probe() for PERST# GPIO
From: phucduc . bui
Date: Mon Oct 12 2026 - 05:53:09 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
Use dev_err_probe() when getting the PERST# GPIO to simplify error
handling and properly handle -EPROBE_DEFER.
Reviewed-by: Manikanta Maddireddy <mmaddireddy@xxxxxxxxxx>
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
Changes in v2:
- Follow the subject line capitalization style.
- Use "PERST#" in the subject, commit log, and dmesg text to match
spec usage.
drivers/pci/controller/dwc/pcie-tegra194.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 63a0f56cad8e..2f8e828c4d9a 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1200,18 +1200,9 @@ static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie)
/* Endpoint mode specific DT entries */
pcie->pex_rst_gpiod = devm_gpiod_get(pcie->dev, "reset", GPIOD_IN);
- if (IS_ERR(pcie->pex_rst_gpiod)) {
- int err = PTR_ERR(pcie->pex_rst_gpiod);
- const char *level = KERN_ERR;
-
- if (err == -EPROBE_DEFER)
- level = KERN_DEBUG;
-
- dev_printk(level, pcie->dev,
- dev_fmt("Failed to get PERST GPIO: %d\n"),
- err);
- return err;
- }
+ if (IS_ERR(pcie->pex_rst_gpiod))
+ return dev_err_probe(pcie->dev, PTR_ERR(pcie->pex_rst_gpiod),
+ "Failed to get PERST# GPIO\n");
pcie->pex_refclk_sel_gpiod = devm_gpiod_get_optional(pcie->dev,
"nvidia,refclk-select",
--
2.43.0