pwm: Set class for exported channels in sysfs
PATCH RESEND 1/1 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.
--- drivers/pwm/sysfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/pwm/sysfs.c +1 -0
@@ -263,6 +263,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm) export->pwm = pwm;mutex_init (&export->lock); + export->child.class = parent->class; export->child.release = pwm_export_release; export->child.parent = parent; export->child.devt =MKDEV (0 ,0 );
Signature · 1 line
2.1.4
PATCH RESEND 1/1 pwm: Set class for exported channels in sysfs
Quoted 14 lines · Gottfried Haider
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 <[email protected]>CC Thierry Reding <[email protected]>CC H Hartley Sweeten <[email protected]>CC linux-pwm at vger.kernel.orgCC linux-arm-kernel at lists.infradead.orgCC linux-rpi-kernel at lists.infradead.org
Quoted 3 lines
--- drivers/pwm/sysfs.c | 1 + 1 file changed, 1 insertion(+)
Sorry for the long delay, applied to for-next now.
Thanks,
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171205/5ba41b60/attachment-0001.sig>