From patchwork Wed Dec 4 10:29:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 296471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8FA212C00B1 for ; Wed, 4 Dec 2013 21:30:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755456Ab3LDKaA (ORCPT ); Wed, 4 Dec 2013 05:30:00 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:50745 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755249Ab3LDK37 (ORCPT ); Wed, 4 Dec 2013 05:29:59 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so22029589pde.20 for ; Wed, 04 Dec 2013 02:29:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=KNkk2JiP9qCBkjkyxJTBYUHPLELtvk3RIcE3YfYLSmU=; b=ZEcQ9a0GIl5u7MksYdayDZSoPaAfjCoEsUKO8g4cGYqf9HuPWaEWnMXYCNHxSUFTGq nPjSupqc+BQuy40V0/AjRsLjb6XyYNbIUK4isxa9EMvUFeDRMnfeIRauEnh9ZTJEjWe+ AgPmhBxNZFsx6rktBWHMJMOEy2ikiwL9JMjCMZyVtkyFChSMTeZxZbPlfU3MirZhPKDJ x++5Qiee+hQDxLnJWj1j1yA/ibq8PVWKvLOvl4R0xZzLLrdRFCQsvzXo3hIBfCqlFqgj 2+hsOaslXA00GTM8IhWNFSz+EzY8MFc+d5N8jxJvA2s3qDBwvV51fcyTXEH4VOKYtlwk CU8g== X-Gm-Message-State: ALoCoQnWTO/Am2WB+Tl6mGfHGId9bCYgamT+OKa1VY3jZ6Xcc8/X0VVvOARUWhJWbyYV5xPEHXF9 X-Received: by 10.66.2.66 with SMTP id 2mr81725402pas.72.1386152998568; Wed, 04 Dec 2013 02:29:58 -0800 (PST) Received: from [192.168.1.102] (111-240-61-77.dynamic.hinet.net. [111.240.61.77]) by mx.google.com with ESMTPSA id ql10sm136310742pbc.44.2013.12.04.02.29.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 02:29:57 -0800 (PST) Message-ID: <1386152993.22135.0.camel@phoenix> Subject: [PATCH v2] pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro From: Axel Lin To: Thierry Reding Cc: H Hartley Sweeten , Rob Landley , linux-pwm@vger.kernel.org Date: Wed, 04 Dec 2013 18:29:53 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code. Signed-off-by: Axel Lin --- 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);