[PATCH v3] pwm: tegra: check reset deassertion status

From: Pengpeng Hou

Date: Wed Dec 02 2026 - 22:33:17 EST


If reset_control_deassert() fails in tegra_pwm_probe(), the PWM chip is
still registered. Report the reset error and take the existing runtime
PM cleanup path before registration. Leave the reset assertion order on
removal unchanged.

The issue was found by our static-analysis tool and manually reviewed.

Acked-by: Thierry Reding <treding@xxxxxxxxxx>
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
Changes since v2:
Report the deassertion error with dev_err_probe() before unwinding PM.
Previous version: https://lore.kernel.org/r/20261014032027.9508-1-hppiscas@xxxxxxx

Codex assisted with patch preparation and the changelog.
Current review: Codex (Assisted-by: gpt 5).
Static review only; this revision was not built.

drivers/pwm/pwm-tegra.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 6d468a673ded2d9109c6f46a43ffbf3ba5df09f6..17014be2c68124592cc57b1f5405d62ee9300205 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -393,7 +393,11 @@ static int tegra_pwm_probe(struct platform_device *pdev)
goto put_pm;
}

- reset_control_deassert(pc->rst);
+ ret = reset_control_deassert(pc->rst);
+ if (ret) {
+ dev_err_probe(&pdev->dev, ret, "Failed to deassert reset\n");
+ goto put_pm;
+ }

chip->ops = &tegra_pwm_ops;


base-commit: d323c02b23e6fb5fa793da658ca11a50d9dfbee5