summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-pxa.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2012-09-02 22:13:40 +0200
committerThierry Reding <thierry.reding@avionic-design.de>2012-10-05 20:56:43 +0200
commitc2d476a98f71c55e9acdca1d5a1080a22c0622af (patch)
tree550ef5612d413d39f6d5928ea261eab9fd859fac /drivers/pwm/pwm-pxa.c
parentpwm: Add Ingenic JZ4740 support (diff)
downloadlinux-c2d476a98f71c55e9acdca1d5a1080a22c0622af.tar.xz
linux-c2d476a98f71c55e9acdca1d5a1080a22c0622af.zip
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 <thierry.reding@avionic-design.de> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Sachin Kamat <sachin.kamat@linaro.org> Cc: Axel Lin <axel.lin@gmail.com> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Jonghwan Choi <jhbird.choi@samsung.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: "Philip, Avinash" <avinashphilip@ti.com> Cc: Vaibhav Bedia <vaibhav.bedia@ti.com> Acked-by: Jingoo Han <jg1.han@samsung.com>
Diffstat (limited to 'drivers/pwm/pwm-pxa.c')
-rw-r--r--drivers/pwm/pwm-pxa.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index bd5867a1c700..260c3a88564d 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -70,9 +70,6 @@ static int pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
unsigned long offset;
int rc;
- if (period_ns == 0 || duty_ns > period_ns)
- return -EINVAL;
-
offset = pwm->hwpwm ? 0x10 : 0;
c = clk_get_rate(pc->clk);