]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: Get rid of pwm->lock
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Wed, 30 Mar 2016 20:03:27 +0000 (22:03 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 17 May 2016 12:44:59 +0000 (14:44 +0200)
commit3bb648f132b3b7be056bd6b02a83aefe1e28d0b2
tree233902a29b5d0f418de168ffe531149b997cbcf4
parentec6094d9558fa8b0d7c244eab85a25a16fa7dff1
pwm: Get rid of pwm->lock

PWM devices are not protected against concurrent accesses. The lock in
struct pwm_device might let PWM users think it is, but it's actually
only protecting the enabled state.

Removing this lock should be fine as long as all PWM users are aware
that accesses to the PWM device have to be serialized, which seems to be
the case for all of them except the sysfs interface. Patch the sysfs
code by adding a lock to the pwm_export struct and making sure it's
taken for all relevant accesses to the exported PWM device.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c
drivers/pwm/sysfs.c
include/linux/pwm.h