[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200109072735.GA22886@embeddedor>
Date: Thu, 9 Jan 2020 01:27:35 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
Clément Péron <peron.clem@...il.com>,
Jernej Skrabec <jernej.skrabec@...l.net>
Cc: linux-pwm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: [PATCH] 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: b8d74644f34a ("pwm: sun4i: Prefer "mod" clock to unnamed")
Fixes: 5b090b430d75 ("pwm: sun4i: Add an optional probe for bus clock")
Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
---
drivers/pwm/pwm-sun4i.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c
index 1afd41ebd3fd..a805c347ee84 100644
--- a/drivers/pwm/pwm-sun4i.c
+++ b/drivers/pwm/pwm-sun4i.c
@@ -423,7 +423,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);
@@ -432,7 +432,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);
@@ -441,7 +441,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);
--
2.23.0
Powered by blists - more mailing lists