diff options
Diffstat (limited to 'drivers/pwm/sysfs.c')
-rw-r--r-- | drivers/pwm/sysfs.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 18ed725594c3..0296d8178ae2 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c | |||
@@ -409,6 +409,24 @@ void pwmchip_sysfs_unexport(struct pwm_chip *chip) | |||
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | void pwmchip_sysfs_unexport_children(struct pwm_chip *chip) | ||
413 | { | ||
414 | struct device *parent; | ||
415 | unsigned int i; | ||
416 | |||
417 | parent = class_find_device(&pwm_class, NULL, chip, | ||
418 | pwmchip_sysfs_match); | ||
419 | if (!parent) | ||
420 | return; | ||
421 | |||
422 | for (i = 0; i < chip->npwm; i++) { | ||
423 | struct pwm_device *pwm = &chip->pwms[i]; | ||
424 | |||
425 | if (test_bit(PWMF_EXPORTED, &pwm->flags)) | ||
426 | pwm_unexport_child(parent, pwm); | ||
427 | } | ||
428 | } | ||
429 | |||
412 | static int __init pwm_sysfs_init(void) | 430 | static int __init pwm_sysfs_init(void) |
413 | { | 431 | { |
414 | return class_register(&pwm_class); | 432 | return class_register(&pwm_class); |