summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/sysfs.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-11-14 12:20:12 +0100
committerThierry Reding <thierry.reding@gmail.com>2023-12-20 16:04:12 +0100
commit54c86dd20bba23109e32e4e2f94ff93dd9863bc3 (patch)
treeb754aa9654ec304f2a96a04f2e8e3f6fb8da2019 /drivers/pwm/sysfs.c
parentf3e25e68ceb2abaeefcac8f930c940c4494705d0 (diff)
downloadlinux-stable-54c86dd20bba23109e32e4e2f94ff93dd9863bc3.tar.gz
linux-stable-54c86dd20bba23109e32e4e2f94ff93dd9863bc3.tar.bz2
linux-stable-54c86dd20bba23109e32e4e2f94ff93dd9863bc3.zip
pwm: Replace PWM chip unique base by unique ID
Traditionally each PWM device had a unique ID stored in the "pwm" member of struct pwm_device. However this number was hardly used and dropped in the previous commit. To identify a certain PWM you're supposed to use the chip's ID and the hwpwm of the PWM device now. With the PWM chip base gone PWM chips can get their IDs better and simpler using an idr. This is expected to change the numbering of PWM chips, but nothing should rely on the numbering anyhow. Other than that the side effects are: - The PWM chip IDs are smaller and in most cases consecutive. - The ordering in /sys/kernel/debug/pwm is ordered by ascending PWM chip ID. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/sysfs.c')
-rw-r--r--drivers/pwm/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index 8d1254761e4d..4edb994fa2e1 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -510,7 +510,7 @@ void pwmchip_sysfs_export(struct pwm_chip *chip)
* the kernel it's just not exported.
*/
parent = device_create(&pwm_class, chip->dev, MKDEV(0, 0), chip,
- "pwmchip%d", chip->base);
+ "pwmchip%d", chip->id);
if (IS_ERR(parent)) {
dev_warn(chip->dev,
"device_create failed for pwm_chip sysfs export\n");