Message ID | 20210505161909.187452-1-u.kleine-koenig@pengutronix.de |
---|---|
State | Accepted |
Headers | show |
Series | [v2,1/2] pwm: pxa: Drop if with an always false condition | expand |
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index cfb683827d32..31752640dcf7 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -210,8 +210,6 @@ static int pwm_remove(struct platform_device *pdev) struct pxa_pwm_chip *chip; chip = platform_get_drvdata(pdev); - if (chip == NULL) - return -ENODEV; return pwmchip_remove(&chip->chip); }
The .remove() function is only called after .probe() returned successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platfrom_get_drvdata() returns the same non-NULL value. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- Hello, only change since implicit v1: s/pwx/pxa/ in the Subject. Patch 2 is unmodified. Best regards Uwe drivers/pwm/pwm-pxa.c | 2 -- 1 file changed, 2 deletions(-) base-commit: a6efb35019d00f483a0e5f188747723371d659fe