From c2d476a98f71c55e9acdca1d5a1080a22c0622af Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Sun, 2 Sep 2012 22:13:40 +0200 Subject: pwm: Check for negative duty-cycle and period Make sure the duty-cycle and period passed in are not negative. This should eventually be made implicit by making them unsigned. While at it, the drivers' .config() implementations can have the equivalent checks removed. Signed-off-by: Thierry Reding Cc: Shawn Guo Cc: Mark Brown Cc: Arnd Bergmann Cc: Sachin Kamat Cc: Axel Lin Cc: Kukjin Kim Cc: Jingoo Han Cc: Jonghwan Choi Cc: Sascha Hauer Cc: "Philip, Avinash" Cc: Vaibhav Bedia Acked-by: Jingoo Han --- drivers/pwm/pwm-bfin.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/pwm/pwm-bfin.c') diff --git a/drivers/pwm/pwm-bfin.c b/drivers/pwm/pwm-bfin.c index d53c4e7941e..5da8e185e83 100644 --- a/drivers/pwm/pwm-bfin.c +++ b/drivers/pwm/pwm-bfin.c @@ -69,9 +69,6 @@ static int bfin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, unsigned long period, duty; unsigned long long val; - if (duty_ns < 0 || duty_ns > period_ns) - return -EINVAL; - val = (unsigned long long)get_sclk() * period_ns; do_div(val, NSEC_PER_SEC); period = val; -- cgit v1.2.3