Skip to contentSkip to conversation

pwm: tegra: check reset deassertion status

PATCH New Pengpeng Hou 1 participant 1 message Dec 3

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
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
index 6d468a673ded2d9109c6f46a43ffbf3ba5df09f6..17014be2c68124592cc57b1f5405d62ee9300205 100644
@@ -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