Skip to content

Commit

Permalink
pwm: vt8500: Drop if with an always false condition
Browse files Browse the repository at this point in the history
vt8500_pwm_remove() is only called after vt8500_pwm_probe() returned
successfully. In this case driver data was set to a non-NULL value
and so chip can never be NULL.

While touching this code also put declaration and assignment in a single
line.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.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 2f1a3bd commit fb2cb3b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/pwm/pwm-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,8 @@ static int vt8500_pwm_probe(struct platform_device *pdev)

static int vt8500_pwm_remove(struct platform_device *pdev)
{
struct vt8500_chip *chip;
struct vt8500_chip *chip = platform_get_drvdata(pdev);

chip = platform_get_drvdata(pdev);
if (chip == NULL)
return -ENODEV;

clk_unprepare(chip->clk);

Expand Down

0 comments on commit fb2cb3b

Please sign in to comment.