kernel: bump 4.14 to 4.14.155
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.14 / 950-0137-pwm-Set-class-for-exported-channels-in-sysfs.patch
1 From dd5e8c9945f3f9a9bd9b307087c2881d8399c87b Mon Sep 17 00:00:00 2001
2 From: Gottfried Haider <gottfried.haider@gmail.com>
3 Date: Tue, 26 Sep 2017 11:59:51 +0000
4 Subject: [PATCH 137/454] pwm: Set class for exported channels in sysfs
5
6 [ Upstream commit 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00 ]
7
8 Notifications for devices without bus or class set get dropped by
9 dev_uevent_filter(). Adding the class to the exported child matches
10 what the GPIO subsystem is doing.
11
12 With this change exporting a channel triggers a udev event, which
13 gives userspace a chance to fixup permissions and makes it possible
14 for non-root users to make use of the PWM subsystem.
15
16 Signed-off-by: Gottfried Haider <gottfried.haider@gmail.com>
17 CC: Thierry Reding <thierry.reding@gmail.com>
18 CC: H Hartley Sweeten <hsweeten@visionengravers.com>
19 CC: linux-pwm@vger.kernel.org
20 CC: linux-arm-kernel@lists.infradead.org
21 CC: linux-rpi-kernel@lists.infradead.org
22 Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
23 ---
24 drivers/pwm/sysfs.c | 1 +
25 1 file changed, 1 insertion(+)
26
27 --- a/drivers/pwm/sysfs.c
28 +++ b/drivers/pwm/sysfs.c
29 @@ -263,6 +263,7 @@ static int pwm_export_child(struct devic
30 export->pwm = pwm;
31 mutex_init(&export->lock);
32
33 + export->child.class = parent->class;
34 export->child.release = pwm_export_release;
35 export->child.parent = parent;
36 export->child.devt = MKDEV(0, 0);