diff mbox series

[2/4] pwm: meson: Drop useless check for channel data being NULL

Message ID 20211108134628.120474-2-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [1/4] pwm: meson: Drop always false check from .request() | expand

Commit Message

Uwe Kleine-König Nov. 8, 2021, 1:46 p.m. UTC
In meson_pwm_free() the function pwm_get_chip_data() always returns a
non-NULL pointer because it's only called when the request callback
succeeded and this callback calls pwm_set_chip_data() in this case.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-meson.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin Blumenstingl Nov. 20, 2021, 11:34 p.m. UTC | #1
On Mon, Nov 8, 2021 at 2:46 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> In meson_pwm_free() the function pwm_get_chip_data() always returns a
> non-NULL pointer because it's only called when the request callback
> succeeded and this callback calls pwm_set_chip_data() in this case.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index be3c806b57e4..1fbe54a2abfe 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -148,8 +148,7 @@  static void meson_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
 {
 	struct meson_pwm_channel *channel = pwm_get_chip_data(pwm);
 
-	if (channel)
-		clk_disable_unprepare(channel->clk);
+	clk_disable_unprepare(channel->clk);
 }
 
 static int meson_pwm_calc(struct meson_pwm *meson, struct pwm_device *pwm,