Commit 6ca142ad authored by Axel Lin's avatar Axel Lin Committed by Thierry Reding

pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro

Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent b52fa7bc
...@@ -169,15 +169,7 @@ static struct attribute *pwm_attrs[] = { ...@@ -169,15 +169,7 @@ static struct attribute *pwm_attrs[] = {
&dev_attr_polarity.attr, &dev_attr_polarity.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(pwm);
static const struct attribute_group pwm_attr_group = {
.attrs = pwm_attrs,
};
static const struct attribute_group *pwm_attr_groups[] = {
&pwm_attr_group,
NULL,
};
static void pwm_export_release(struct device *child) static void pwm_export_release(struct device *child)
{ {
...@@ -205,7 +197,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm) ...@@ -205,7 +197,7 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
export->child.release = pwm_export_release; export->child.release = pwm_export_release;
export->child.parent = parent; export->child.parent = parent;
export->child.devt = MKDEV(0, 0); 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); dev_set_name(&export->child, "pwm%u", pwm->hwpwm);
ret = device_register(&export->child); ret = device_register(&export->child);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment