aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalker Chen <[email protected]>2023-06-08 21:57:49 +0800
committerMark Brown <[email protected]>2023-06-09 10:44:34 +0100
commit3582cf94ff49469ffe78e96014550f7d4e466fbd (patch)
tree53b16a9da8ab239135f13ad03f8289a78cc4f859
parent08e6c4bb17087584261c4aff555d32fc1c620b81 (diff)
ASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get()
Fix the check for devm_reset_control_array_get_exclusive() return value. The devm_reset_control_array_get_exclusive() function may return NULL if it's an optional request. If optional is intended then NULL should not be treated as an error case, but as a special kind of success case. So here the IS_ERR() is used to check better. Signed-off-by: Walker Chen <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/starfive/jh7110_tdm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c
index 973b910d2d3e..a9a3d52bdd2a 100644
--- a/sound/soc/starfive/jh7110_tdm.c
+++ b/sound/soc/starfive/jh7110_tdm.c
@@ -580,10 +580,9 @@ static int jh7110_tdm_clk_reset_get(struct platform_device *pdev,
}
tdm->resets = devm_reset_control_array_get_exclusive(&pdev->dev);
- if (IS_ERR_OR_NULL(tdm->resets)) {
- ret = PTR_ERR(tdm->resets);
- dev_err(&pdev->dev, "Failed to get tdm resets");
- return ret;
+ if (IS_ERR(tdm->resets)) {
+ dev_err(&pdev->dev, "Failed to get tdm resets\n");
+ return PTR_ERR(tdm->resets);
}
return 0;