pwm: Set class for exported channels in sysfs
authorGottfried Haider <gottfried.haider@gmail.com>
Tue, 26 Sep 2017 11:59:51 +0000 (11:59 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 15 Feb 2018 17:41:10 +0000 (17:41 +0000)
commit9aa91c5a30f2fee5f86689fbb21e842f53578875
treebf29a225c74204483d54faa9d707fe99f7597c23
parentd5aa0a9f6ccd53965333f425f36ef6f7111a3e2d
pwm: Set class for exported channels in sysfs

Notifications for devices without bus or class set get dropped by
dev_uevent_filter(). Adding the class to the exported child matches
what the GPIO subsystem is doing.

With this change exporting a channel triggers a udev event, which
gives userspace a chance to fixup permissions and makes it possible
for non-root users to make use of the PWM subsystem.

Signed-off-by: Gottfried Haider <gottfried.haider@gmail.com>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: H Hartley Sweeten <hsweeten@visionengravers.com>
CC: linux-pwm@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: linux-rpi-kernel@lists.infradead.org
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/sysfs.c