linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RESEND][PATCH] pwm: Set class for exported channels in sysfs
@ 2017-06-02 10:05 Gottfried Haider
  2017-12-05  8:27 ` Thierry Reding
  0 siblings, 1 reply; 6+ messages in thread
From: Gottfried Haider @ 2017-06-02 10:05 UTC (permalink / raw)
  To: linux-arm-kernel

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 at vger.kernel.org
CC: linux-arm-kernel at lists.infradead.org
CC: linux-rpi-kernel at lists.infradead.org
---
 drivers/pwm/sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index a813239..83f2b0b 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -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);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [RESEND][PATCH] pwm: Set class for exported channels in sysfs
@ 2017-09-26 11:59 gohai at sukzessiv.net
  2017-10-12 17:33 ` Stefan Wahren
  2018-03-30 12:40 ` Fabrice Gasnier
  0 siblings, 2 replies; 6+ messages in thread
From: gohai at sukzessiv.net @ 2017-09-26 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

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 at vger.kernel.org
CC: linux-arm-kernel at lists.infradead.org
CC: linux-rpi-kernel at lists.infradead.org
---
 drivers/pwm/sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index a813239..83f2b0b 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-19 11:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-02 10:05 [RESEND][PATCH] pwm: Set class for exported channels in sysfs Gottfried Haider
2017-12-05  8:27 ` Thierry Reding
  -- strict thread matches above, loose matches on Subject: below --
2017-09-26 11:59 gohai at sukzessiv.net
2017-10-12 17:33 ` Stefan Wahren
2018-03-30 12:40 ` Fabrice Gasnier
2018-05-19 11:50   ` Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).