* [PATCH v2] pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
@ 2013-12-04 10:29 Axel Lin
2013-12-04 10:36 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-12-04 10:29 UTC (permalink / raw)
To: Thierry Reding; +Cc: H Hartley Sweeten, Rob Landley, linux-pwm
Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
v2: update commit log
drivers/pwm/sysfs.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
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);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
2013-12-04 10:29 [PATCH v2] pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro Axel Lin
@ 2013-12-04 10:36 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2013-12-04 10:36 UTC (permalink / raw)
To: Axel Lin; +Cc: H Hartley Sweeten, Rob Landley, linux-pwm
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
On Wed, Dec 04, 2013 at 06:29:53PM +0800, Axel Lin wrote:
> Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> v2: update commit log
> drivers/pwm/sysfs.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-04 10:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 10:29 [PATCH v2] pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro Axel Lin
2013-12-04 10:36 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).