diff options
Diffstat (limited to 'drivers/pwm/core.c')
-rw-r--r-- | drivers/pwm/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 92b1782d0d8..f5acdaa5270 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c | |||
@@ -371,7 +371,7 @@ EXPORT_SYMBOL_GPL(pwm_free); | |||
371 | */ | 371 | */ |
372 | int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) | 372 | int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) |
373 | { | 373 | { |
374 | if (!pwm || period_ns == 0 || duty_ns > period_ns) | 374 | if (!pwm || duty_ns < 0 || period_ns <= 0 || duty_ns > period_ns) |
375 | return -EINVAL; | 375 | return -EINVAL; |
376 | 376 | ||
377 | return pwm->chip->ops->config(pwm->chip, pwm, duty_ns, period_ns); | 377 | return pwm->chip->ops->config(pwm->chip, pwm, duty_ns, period_ns); |