Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333108
b: refs/heads/master
c: c2d476a
h: refs/heads/master
v: v3
  • Loading branch information
Thierry Reding committed Oct 5, 2012
1 parent 9530194 commit ab5085e
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6b8a5700057cc1b531c2f9b7806428a6f83b467
refs/heads/master: c2d476a98f71c55e9acdca1d5a1080a22c0622af
2 changes: 1 addition & 1 deletion trunk/drivers/pwm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ EXPORT_SYMBOL_GPL(pwm_free);
*/
int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
{
if (!pwm || period_ns == 0 || duty_ns > period_ns)
if (!pwm || duty_ns < 0 || period_ns <= 0 || duty_ns > period_ns)
return -EINVAL;

return pwm->chip->ops->config(pwm->chip, pwm, duty_ns, period_ns);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/pwm/pwm-bfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/pwm/pwm-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/pwm/pwm-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ static int s3c_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
if (period_ns > NS_IN_HZ || duty_ns > NS_IN_HZ)
return -ERANGE;

if (duty_ns > period_ns)
return -EINVAL;

if (period_ns == s3c->period_ns &&
duty_ns == s3c->duty_ns)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pwm/pwm-tiecap.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
unsigned long period_cycles, duty_cycles;
unsigned int reg_val;

if (period_ns < 0 || duty_ns < 0 || period_ns > NSEC_PER_SEC)
if (period_ns > NSEC_PER_SEC)
return -ERANGE;

c = pc->clk_rate;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pwm/pwm-tiehrpwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int ehrpwm_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
unsigned short ps_divval, tb_divval;
int i, cmp_reg;

if (period_ns < 0 || duty_ns < 0 || period_ns > NSEC_PER_SEC)
if (period_ns > NSEC_PER_SEC)
return -ERANGE;

c = pc->clk_rate;
Expand Down

0 comments on commit ab5085e

Please sign in to comment.