diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-12-04 11:29:53 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2013-12-04 11:35:28 +0100 |
commit | 6ca142ad0d1bdf8dd116351b7b9a2bc5670d5271 (patch) | |
tree | 7d123301e7dbdda3f281a4db268b35b4e6361e59 /drivers/pwm | |
parent | pwm: pxa: Add device tree support (diff) | |
download | linux-6ca142ad0d1bdf8dd116351b7b9a2bc5670d5271.tar.xz linux-6ca142ad0d1bdf8dd116351b7b9a2bc5670d5271.zip |
pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/sysfs.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 8c20332d4825..4bd0c639e16d 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -169,15 +169,7 @@ static struct attribute *pwm_attrs[] = { &dev_attr_polarity.attr, NULL }; - -static const struct attribute_group pwm_attr_group = { - .attrs = pwm_attrs, -}; - -static const struct attribute_group *pwm_attr_groups[] = { - &pwm_attr_group, - NULL, -}; +ATTRIBUTE_GROUPS(pwm); static void pwm_export_release(struct device *child) { @@ -205,7 +197,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm) export->child.release = pwm_export_release; export->child.parent = parent; export->child.devt = MKDEV(0, 0); - export->child.groups = pwm_attr_groups; + export->child.groups = pwm_groups; dev_set_name(&export->child, "pwm%u", pwm->hwpwm); ret = device_register(&export->child); |