PCI: tegra194: Use dev_err_probe() for PERST# GPIO
PATCH v2 1/2 PCI: tegra194: Use dev_err_probe() for PERST# GPIO
From: bui duc phuc <[email protected]>
Use dev_err_probe() when getting the PERST# GPIO to simplify error handling and properly handle -EPROBE_DEFER.
---
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(-)
drivers/pci/controller/dwc/pcie-tegra194.c +3 -12
@@ -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",
Signature · 1 line
2.43.0
PATCH v2 2/2 PCI: tegra194: Propagate REFCLK select GPIO errors
From: bui duc phuc <[email protected]>
devm_gpiod_get_optional() returns NULL when the optional GPIO is not present, but may return -EPROBE_DEFER or other errors.
The current code treats GPIO lookup errors as if the GPIO were not present.
Check the return value and propagate errors from the REFCLK select GPIO lookup.
---
Changes in v2:
- Follow the subject line capitalization style.
drivers/pci/controller/dwc/pcie-tegra194.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/pci/controller/dwc/pcie-tegra194.c +3 -12
@@ -1207,18 +1207,9 @@ static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie) pcie->pex_refclk_sel_gpiod =devm_gpiod_get_optional (pcie->dev,"nvidia,refclk-select" ,GPIOD_OUT_HIGH ); -if (IS_ERR (pcie->pex_refclk_sel_gpiod)) { -int err =PTR_ERR (pcie->pex_refclk_sel_gpiod); -const char *level =KERN_ERR ; - -if (err == -EPROBE_DEFER ) - level =KERN_DEBUG ; - -dev_printk (level, pcie->dev, -dev_fmt ("Failed to get REFCLK select GPIOs: %d\n" ), - err); - pcie->pex_refclk_sel_gpiod =NULL ; - } +if (IS_ERR (pcie->pex_refclk_sel_gpiod)) +return dev_err_probe (pcie->dev,PTR_ERR (pcie->pex_refclk_sel_gpiod), +"Failed to get REFCLK select GPIO\n" );return 0 ; }
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v2 2/2] PCI: tegra194: Propagate REFCLK select GPIO errors
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines
From: bui duc phuc <[email protected]>
devm_gpiod_get_optional()returns NULL when the optional GPIO is not present, but may return -EPROBE_DEFER or other errors.
Quoted 8 lines
The current code treats GPIO lookup errors as if the GPIO were not present.
Check the return value and propagate errors from the REFCLK select GPIO lookup.
Reviewed-by Manikanta Maddireddy <[email protected]>Signed-off-by bui duc phuc <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines
From: bui duc phuc <[email protected]>
Use
dev_err_probe()when getting the PERST# GPIO to simplify error handling and properly handle -EPROBE_DEFER.Reviewed-by Manikanta Maddireddy <[email protected]>Signed-off-by bui duc phuc <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 9 lines · On Mon, Oct 12, 2026 at 04:48:14PM +0700, [email protected] wrote:
From: bui duc phuc <[email protected]>
Use
dev_err_probe()when getting the PERST# GPIO to simplify error handling and properly handle -EPROBE_DEFER.Reviewed-by Manikanta Maddireddy <[email protected]>Signed-off-by bui duc phuc <[email protected]>---
Quoted 7 lines
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(-)
Re: [PATCH v2 2/2] PCI: tegra194: Propagate REFCLK select GPIO errors
In reply to [email protected]Quoted 11 lines · On Mon, Oct 12, 2026 at 04:48:15PM +0700, [email protected] wrote:
From: bui duc phuc <[email protected]>
devm_gpiod_get_optional()returns NULL when the optional GPIO is not present, but may return -EPROBE_DEFER or other errors.The current code treats GPIO lookup errors as if the GPIO were not present.
Check the return value and propagate errors from the REFCLK select GPIO lookup.
Quoted 8 lines
Reviewed-by Manikanta Maddireddy <[email protected]>Signed-off-by bui duc phuc <[email protected]>---
Changes in v2:
- Follow the subject line capitalization style.drivers/pci/controller/dwc/pcie-tegra194.c | 15 +++------------
Quoted 1 line · On Mon, 12 Oct 2026 16:48:14 +0700, [email protected] wrote:
PCI: tegra194: Use
dev_err_probe()for PERST# GPIO
Applied, thanks!
[1/2] PCI: tegra194: Use dev_err_probe() for PERST# GPIO
commit: d9b0c9ec352a5c8f037607bb938b6410ecf0dd54
[2/2] PCI: tegra194: Propagate REFCLK select GPIO errors
commit: a439b860c96071e17d8877d28d0effdd42f60413Best regards,
Signature · 1 line
மணிவண்ணன் சதாசிவம்