pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
diff mbox

Message ID 1386139970.9997.1.camel@phoenix
State Superseded
Headers show

Commit Message

Axel Lin Dec. 4, 2013, 6:52 a.m. UTC
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pwm/sysfs.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Comments

Thierry Reding Dec. 4, 2013, 10:05 a.m. UTC | #1
On Wed, Dec 04, 2013 at 02:52:50PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/pwm/sysfs.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)

Looks good. Can you please add a commit message? If nothing else it
could say what the advantages are of using the macro, even if that may
be somewhat obvious.

Thierry

Patch
diff mbox

diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index 8c20332..4bd0c63 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);