diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:39 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2013-07-29 03:08:33 -0400 |
commit | 9da01759636f519967c0922ae12bd9fff739db9a (patch) | |
tree | 38077c9ca7bb8a54aae6fd8d8fa9d7945bd1102c | |
parent | 5ae90d8e467e625e447000cb4335c4db973b1095 (diff) |
pwm: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the PWM class code to use the
correct field.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r-- | drivers/pwm/sysfs.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 8ca5de316d3b..8c20332d4825 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c | |||
@@ -268,6 +268,7 @@ static ssize_t pwm_export_store(struct device *parent, | |||
268 | 268 | ||
269 | return ret ? : len; | 269 | return ret ? : len; |
270 | } | 270 | } |
271 | static DEVICE_ATTR(export, 0200, NULL, pwm_export_store); | ||
271 | 272 | ||
272 | static ssize_t pwm_unexport_store(struct device *parent, | 273 | static ssize_t pwm_unexport_store(struct device *parent, |
273 | struct device_attribute *attr, | 274 | struct device_attribute *attr, |
@@ -288,27 +289,29 @@ static ssize_t pwm_unexport_store(struct device *parent, | |||
288 | 289 | ||
289 | return ret ? : len; | 290 | return ret ? : len; |
290 | } | 291 | } |
292 | static DEVICE_ATTR(unexport, 0200, NULL, pwm_unexport_store); | ||
291 | 293 | ||
292 | static ssize_t pwm_npwm_show(struct device *parent, | 294 | static ssize_t npwm_show(struct device *parent, struct device_attribute *attr, |
293 | struct device_attribute *attr, | 295 | char *buf) |
294 | char *buf) | ||
295 | { | 296 | { |
296 | const struct pwm_chip *chip = dev_get_drvdata(parent); | 297 | const struct pwm_chip *chip = dev_get_drvdata(parent); |
297 | 298 | ||
298 | return sprintf(buf, "%u\n", chip->npwm); | 299 | return sprintf(buf, "%u\n", chip->npwm); |
299 | } | 300 | } |
301 | static DEVICE_ATTR_RO(npwm); | ||
300 | 302 | ||
301 | static struct device_attribute pwm_chip_attrs[] = { | 303 | static struct attribute *pwm_chip_attrs[] = { |
302 | __ATTR(export, 0200, NULL, pwm_export_store), | 304 | &dev_attr_export.attr, |
303 | __ATTR(unexport, 0200, NULL, pwm_unexport_store), | 305 | &dev_attr_unexport.attr, |
304 | __ATTR(npwm, 0444, pwm_npwm_show, NULL), | 306 | &dev_attr_npwm.attr, |
305 | __ATTR_NULL, | 307 | NULL, |
306 | }; | 308 | }; |
309 | ATTRIBUTE_GROUPS(pwm_chip); | ||
307 | 310 | ||
308 | static struct class pwm_class = { | 311 | static struct class pwm_class = { |
309 | .name = "pwm", | 312 | .name = "pwm", |
310 | .owner = THIS_MODULE, | 313 | .owner = THIS_MODULE, |
311 | .dev_attrs = pwm_chip_attrs, | 314 | .dev_groups = pwm_chip_groups, |
312 | }; | 315 | }; |
313 | 316 | ||
314 | static int pwmchip_sysfs_match(struct device *parent, const void *data) | 317 | static int pwmchip_sysfs_match(struct device *parent, const void *data) |