Skip to content

Commit fb2cb3b

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: vt8500: Drop if with an always false condition
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>
1 parent 2f1a3bd commit fb2cb3b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/pwm/pwm-vt8500.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,8 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
238238

239239
static int vt8500_pwm_remove(struct platform_device *pdev)
240240
{
241-
struct vt8500_chip *chip;
241+
struct vt8500_chip *chip = platform_get_drvdata(pdev);
242242

243-
chip = platform_get_drvdata(pdev);
244-
if (chip == NULL)
245-
return -ENODEV;
246243

247244
clk_unprepare(chip->clk);
248245

0 commit comments

Comments
 (0)