Skip to content

Commit

Permalink
pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Thierry Reding committed Dec 4, 2013
1 parent b52fa7b commit 6ca142a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/pwm/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6ca142a

Please sign in to comment.