* [PATCH v3] pwm: tegra: check reset deassertion status
@ 2026-12-03 3:32 Pengpeng Hou
0 siblings, 0 replies; only message in thread
From: Pengpeng Hou @ 2026-12-03 3:32 UTC (permalink / raw)
To: Thierry Reding
Cc: Pengpeng Hou, Jonathan Hunter, Philipp Zabel, linux-pwm,
linux-tegra, linux-kernel, Uwe Kleine-König
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@nvidia.com>
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
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@163.com
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-03 3:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-03 3:32 [PATCH v3] pwm: tegra: check reset deassertion status Pengpeng Hou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®