Skip to content

Commit 8ee1c0f

Browse files
bijudasdlezcano
authored andcommitted
thermal/drivers/rz2gl: Add error check for reset_control_deassert()
If reset_control_deassert() fails, then we won't be able to access the device registers. Therefore check the return code of reset_control_deassert() and bail out in case of error. While at it replace the parameter "&pdev->dev" -> "dev" in devm_reset_control_get_exclusive(). Suggested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20211208164010.4130-1-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 3de89d8 commit 8ee1c0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/thermal/rzg2l_thermal.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ static int rzg2l_thermal_probe(struct platform_device *pdev)
170170
return PTR_ERR(priv->base);
171171

172172
priv->dev = dev;
173-
priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
173+
priv->rstc = devm_reset_control_get_exclusive(dev, NULL);
174174
if (IS_ERR(priv->rstc))
175175
return dev_err_probe(dev, PTR_ERR(priv->rstc),
176176
"failed to get cpg reset");
177177

178-
reset_control_deassert(priv->rstc);
178+
ret = reset_control_deassert(priv->rstc);
179+
if (ret)
180+
return dev_err_probe(dev, ret, "failed to deassert");
179181

180182
pm_runtime_enable(dev);
181183
pm_runtime_get_sync(dev);

0 commit comments

Comments
 (0)