Skip to content

Commit

Permalink
pwm: tegra: Drop an if block with an always false condition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Thierry Reding committed Jun 30, 2021
1 parent 9ae241d commit c1b8ac9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/pwm/pwm-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c1b8ac9

Please sign in to comment.