pwm: tegra: Drop an if block with an always false condition
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 17 Jun 2021 09:51:40 +0000 (11:51 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 30 Jun 2021 17:12:20 +0000 (19:12 +0200)
tegra_pwm_remove() is only called after tegra_pwm_probe() successfully
completed. In this case platform_set_drvdata() was called with a
non-NULL value and so platform_get_drvdata(pdev) cannot return NULL.

Returning an error code from a platform_driver's remove function is
ignored anyway, so it's a good thing this exit path is gone.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-tegra.c

index c529a17..fa02579 100644 (file)
@@ -303,9 +303,6 @@ static int tegra_pwm_remove(struct platform_device *pdev)
        unsigned int i;
        int err;
 
-       if (WARN_ON(!pc))
-               return -ENODEV;
-
        err = clk_prepare_enable(pc->clk);
        if (err < 0)
                return err;