pwm: tegra: check reset deassertion status
Subsystems (3)
PATCH v3 1/1 pwm: tegra: check reset deassertion status
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 <[email protected]>
Signed-off-by Pengpeng Hou <[email protected]>
---
Changes since v2:
Report the deassertion error with dev_err_probe() before unwinding PM. Previous version: https://lore.kernel.org/r/[email protected]
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(-)
drivers/pwm/pwm-tegra.c +5 -1
@@ -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