diff options
Diffstat (limited to 'drivers/pwm/sysfs.c')
-rw-r--r-- | drivers/pwm/sysfs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 9903c3a7eced..e7db8e45001c 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -42,7 +42,7 @@ static ssize_t period_show(struct device *child, pwm_get_state(pwm, &state); - return sprintf(buf, "%llu\n", state.period); + return sysfs_emit(buf, "%llu\n", state.period); } static ssize_t period_store(struct device *child, @@ -77,7 +77,7 @@ static ssize_t duty_cycle_show(struct device *child, pwm_get_state(pwm, &state); - return sprintf(buf, "%llu\n", state.duty_cycle); + return sysfs_emit(buf, "%llu\n", state.duty_cycle); } static ssize_t duty_cycle_store(struct device *child, @@ -112,7 +112,7 @@ static ssize_t enable_show(struct device *child, pwm_get_state(pwm, &state); - return sprintf(buf, "%d\n", state.enabled); + return sysfs_emit(buf, "%d\n", state.enabled); } static ssize_t enable_store(struct device *child, @@ -171,7 +171,7 @@ static ssize_t polarity_show(struct device *child, break; } - return sprintf(buf, "%s\n", polarity); + return sysfs_emit(buf, "%s\n", polarity); } static ssize_t polarity_store(struct device *child, @@ -212,7 +212,7 @@ static ssize_t capture_show(struct device *child, if (ret) return ret; - return sprintf(buf, "%u %u\n", result.period, result.duty_cycle); + return sysfs_emit(buf, "%u %u\n", result.period, result.duty_cycle); } static DEVICE_ATTR_RW(period); @@ -361,7 +361,7 @@ static ssize_t npwm_show(struct device *parent, struct device_attribute *attr, { const struct pwm_chip *chip = dev_get_drvdata(parent); - return sprintf(buf, "%u\n", chip->npwm); + return sysfs_emit(buf, "%u\n", chip->npwm); } static DEVICE_ATTR_RO(npwm); @@ -433,7 +433,7 @@ static int pwm_class_resume_npwm(struct device *parent, unsigned int npwm) return ret; } -static int __maybe_unused pwm_class_suspend(struct device *parent) +static int pwm_class_suspend(struct device *parent) { struct pwm_chip *chip = dev_get_drvdata(parent); unsigned int i; @@ -464,20 +464,20 @@ static int __maybe_unused pwm_class_suspend(struct device *parent) return ret; } -static int __maybe_unused pwm_class_resume(struct device *parent) +static int pwm_class_resume(struct device *parent) { struct pwm_chip *chip = dev_get_drvdata(parent); return pwm_class_resume_npwm(parent, chip->npwm); } -static SIMPLE_DEV_PM_OPS(pwm_class_pm_ops, pwm_class_suspend, pwm_class_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pwm_class_pm_ops, pwm_class_suspend, pwm_class_resume); static struct class pwm_class = { .name = "pwm", .owner = THIS_MODULE, .dev_groups = pwm_chip_groups, - .pm = &pwm_class_pm_ops, + .pm = pm_sleep_ptr(&pwm_class_pm_ops), }; static int pwmchip_sysfs_match(struct device *parent, const void *data) |