linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] Revert "pwm: Set class for exported channels in sysfs"
@ 2018-09-21 14:02 Fabrice Gasnier
  2018-09-24 11:53 ` Thierry Reding
  0 siblings, 1 reply; 10+ messages in thread
From: Fabrice Gasnier @ 2018-09-21 14:02 UTC (permalink / raw)
  To: thierry.reding, stefan.wahren, gohai
  Cc: hsweeten, gottfried.haider, loic.pallardy, broonie,
	fabrice.gasnier, linux-arm-kernel, linux-rpi-kernel,
	linux-kernel, linux-pwm

This reverts commit 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00 as it causes
regression with multiple pwm chip. It creates a new entry in
'/sys/class/pwm' every time a 'pwmX' is exported with 'echo X > export':
- 1st time export will create an entry in /sys/class/pwm/pwmX
- when another export happens on another pwmchip, it can't be created
(e.g. -EEXIST)

This also changes existing ABI (Documentation/ABI/testing/sysfs-class-pwm):
- pmwX should be there: /sys/class/pwm/pwmchipN/pwmX

Example on stm32 (stm32429i-eval) platform:
$ ls /sys/class/pwm
pwmchip0 pwmchip4

$ cd /sys/class/pwm/pwmchip0/
$ echo 0 > export
$ ls /sys/class/pwm
pwm0 pwmchip0 pwmchip4

$ cd /sys/class/pwm/pwmchip4/
$ echo 0 > export
sysfs: cannot create duplicate filename '/class/pwm/pwm0'
...Exception stack follows...

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 drivers/pwm/sysfs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index 7c71cdb..4726d43 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -263,7 +263,6 @@ 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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [RESEND PATCH] Revert "pwm: Set class for exported channels in sysfs"
@ 2018-07-20  7:27 Fabrice Gasnier
  0 siblings, 0 replies; 10+ messages in thread
From: Fabrice Gasnier @ 2018-07-20  7:27 UTC (permalink / raw)
  To: thierry.reding, stefan.wahren, gohai
  Cc: hsweeten, gottfried.haider, loic.pallardy, broonie,
	fabrice.gasnier, linux-arm-kernel, linux-rpi-kernel,
	linux-kernel, linux-pwm

This reverts commit 7e5d1fd75c3dde9fc10c4472b9368089d1b81d00 as it causes
regression with multiple pwm chip. It creates a new entry in
'/sys/class/pwm' every time a 'pwmX' is exported with 'echo X > export':
- 1st time export will create an entry in /sys/class/pwm/pwmX
- when another export happens on another pwmchip, it can't be created
(e.g. -EEXIST)

This also changes existing ABI (Documentation/ABI/testing/sysfs-class-pwm):
- pmwX should be there: /sys/class/pwm/pwmchipN/pwmX

Example on stm32 (stm32429i-eval) platform:
$ ls /sys/class/pwm
pwmchip0 pwmchip4

$ cd /sys/class/pwm/pwmchip0/
$ echo 0 > export
$ ls /sys/class/pwm
pwm0 pwmchip0 pwmchip4

$ cd /sys/class/pwm/pwmchip4/
$ echo 0 > export
sysfs: cannot create duplicate filename '/class/pwm/pwm0'
...Exception stack follows...

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 drivers/pwm/sysfs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index 7c71cdb..4726d43 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -263,7 +263,6 @@ 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);
-- 
1.9.1


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

end of thread, other threads:[~2018-10-01 13:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21 14:02 [RESEND PATCH] Revert "pwm: Set class for exported channels in sysfs" Fabrice Gasnier
2018-09-24 11:53 ` Thierry Reding
2018-09-24 13:59   ` Fabrice Gasnier
2018-09-24 14:23     ` Thierry Reding
2018-09-24 15:50       ` Fabrice Gasnier
2018-09-25 13:59         ` Fabrice Gasnier
2018-09-25 15:20           ` Thierry Reding
2018-09-29  0:19             ` Gottfried Haider
2018-10-01 13:28               ` Fabrice Gasnier
  -- strict thread matches above, loose matches on Subject: below --
2018-07-20  7:27 Fabrice Gasnier

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).