Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pwm/for-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm fixes from Thierry Reding:
"These changes fix a bit of fallout from the introduction of the atomic
API"

* tag 'pwm/for-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
pwm: atmel-hlcdc: Fix default PWM polarity
pwm: sysfs: Get return value from pwm_apply_state()
pwm: Improve args checking in pwm_apply_state()

+7 -3
+2 -1
drivers/pwm/core.c
··· 457 457 { 458 458 int err; 459 459 460 - if (!pwm) 460 + if (!pwm || !state || !state->period || 461 + state->duty_cycle > state->period) 461 462 return -EINVAL; 462 463 463 464 if (!memcmp(state, &pwm->state, sizeof(*state)))
+1 -1
drivers/pwm/pwm-atmel-hlcdc.c
··· 272 272 chip->chip.of_pwm_n_cells = 3; 273 273 chip->chip.can_sleep = 1; 274 274 275 - ret = pwmchip_add(&chip->chip); 275 + ret = pwmchip_add_with_polarity(&chip->chip, PWM_POLARITY_INVERSED); 276 276 if (ret) { 277 277 clk_disable_unprepare(hlcdc->periph_clk); 278 278 return ret;
+1 -1
drivers/pwm/sysfs.c
··· 152 152 goto unlock; 153 153 } 154 154 155 - pwm_apply_state(pwm, &state); 155 + ret = pwm_apply_state(pwm, &state); 156 156 157 157 unlock: 158 158 mutex_unlock(&export->lock);
+3
include/linux/pwm.h
··· 235 235 if (!pwm) 236 236 return -EINVAL; 237 237 238 + if (duty_ns < 0 || period_ns < 0) 239 + return -EINVAL; 240 + 238 241 pwm_get_state(pwm, &state); 239 242 if (state.duty_cycle == duty_ns && state.period == period_ns) 240 243 return 0;