Commit cba8d3bf authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Thierry Reding

pwm: sun4i: Fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in sun4i_pwm_probe().

The proper pointers to be passed as arguments are pwm->clk and pwm->bus_clk.

This bug was detected with the help of Coccinelle.

Fixes: b8d74644 ("pwm: sun4i: Prefer "mod" clock to unnamed")
Fixes: 5b090b43 ("pwm: sun4i: Add an optional probe for bus clock")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 3e954d96
......@@ -422,7 +422,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
*/
pwm->clk = devm_clk_get_optional(&pdev->dev, "mod");
if (IS_ERR(pwm->clk)) {
if (PTR_ERR(pwm->rst) != -EPROBE_DEFER)
if (PTR_ERR(pwm->clk) != -EPROBE_DEFER)
dev_err(&pdev->dev, "get mod clock failed %pe\n",
pwm->clk);
return PTR_ERR(pwm->clk);
......@@ -431,7 +431,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
if (!pwm->clk) {
pwm->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pwm->clk)) {
if (PTR_ERR(pwm->rst) != -EPROBE_DEFER)
if (PTR_ERR(pwm->clk) != -EPROBE_DEFER)
dev_err(&pdev->dev, "get unnamed clock failed %pe\n",
pwm->clk);
return PTR_ERR(pwm->clk);
......@@ -440,7 +440,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
pwm->bus_clk = devm_clk_get_optional(&pdev->dev, "bus");
if (IS_ERR(pwm->bus_clk)) {
if (PTR_ERR(pwm->rst) != -EPROBE_DEFER)
if (PTR_ERR(pwm->bus_clk) != -EPROBE_DEFER)
dev_err(&pdev->dev, "get bus clock failed %pe\n",
pwm->bus_clk);
return PTR_ERR(pwm->bus_clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment