summaryrefslogtreecommitdiffstats
path: root/include/linux/pwm.h
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2016-03-30 22:03:27 +0200
committerThierry Reding <thierry.reding@gmail.com>2016-05-17 14:44:59 +0200
commit459a25afe97cb3d7f978b90c881f4d7aac8fb755 (patch)
tree233902a29b5d0f418de168ffe531149b997cbcf4 /include/linux/pwm.h
parent4ff66efd59102280a71d432c9f0e89cdaf66b849 (diff)
downloadlinux-459a25afe97cb3d7f978b90c881f4d7aac8fb755.tar.gz
linux-459a25afe97cb3d7f978b90c881f4d7aac8fb755.tar.bz2
linux-459a25afe97cb3d7f978b90c881f4d7aac8fb755.zip
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>
Diffstat (limited to 'include/linux/pwm.h')
-rw-r--r--include/linux/pwm.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index b78d27c42629..d2e7430ccedb 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -106,7 +106,6 @@ enum {
* @pwm: global index of the PWM device
* @chip: PWM chip providing this PWM device
* @chip_data: chip-private data associated with the PWM device
- * @lock: used to serialize accesses to the PWM device where necessary
* @period: period of the PWM signal (in nanoseconds)
* @duty_cycle: duty cycle of the PWM signal (in nanoseconds)
* @polarity: polarity of the PWM signal
@@ -119,7 +118,6 @@ struct pwm_device {
unsigned int pwm;
struct pwm_chip *chip;
void *chip_data;
- struct mutex lock;
unsigned int period;
unsigned int duty_cycle;