Received: by 10.223.185.116 with SMTP id b49csp6169287wrg; Wed, 28 Feb 2018 05:12:29 -0800 (PST) X-Google-Smtp-Source: AH8x224nUZtjVVNDGgxoAwVB5QEok1DlE8flUfxGnDWFhEFNxQWUKETBazg+wH2WK237+dg5vfJi X-Received: by 10.101.73.141 with SMTP id r13mr14184666pgs.161.1519823549026; Wed, 28 Feb 2018 05:12:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519823548; cv=none; d=google.com; s=arc-20160816; b=OMau8Jw3vd9HTCbC67DE/+bvZdijl0AkKrrhpvrDhs/YTKoY47r0gKsckT+nKH49HM Lk2Yf1QyXFG6sXCom+2JT4Y2ws6wFXTkgLMKs+iCE1pQrGUgco27175EboKtsb5TbGsc FczfHDD+FrzO/SQ6B/RPUcussl3f2RZ34SNY8XsHWPWpUkxHYbrjReQM70Ye4qowWOMS LqOwqETPmuZJTbCOA+XWGwWn+/bPdvp1Wfkf/eLeoqWE2zzhd+4Sgu8ykhVC+DgKOyYq HfYtPuvrMPHdeFMuJFfRJULevRyuuxV4l7kRzTkj/CGUInAIr/dBb/Anb04IkVW12+QC AWVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=lR6y2h72iEVPbxgXRpIZB/+41Wpyjvuc0ITvNwiG8iQ=; b=psS9ONJW2DgdeY/2Zsrh3aTZr6DixBxL+V7oZ2tBC63YkuxyMfC6QRtdGNqd92ReWb azRwMWvOp5F2MKykmfjlUbDBCk+XswsgZwAgmumfzx3icuwPgkUyv8I/EocoXf+jVzSu pCFZVfKwMMLSj5aEFZOEFYATWxdQZbVMmtIkXsqtpxPlQzJom3L2mb0HON7zZZCCzv6z atfkamPzzshcQU3MsGVL+PSoZdJE8fV1QxdVnHno8YdnJY376k4lhUAigdU+6TI0Dbnk 9cXiRu4KLdRfF4soROpUzO7eADz4JmyrbuvyMYSy62i7AqSQgNYPcOIShdZcbPVVVwg2 lu3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si995290pgc.727.2018.02.28.05.12.11; Wed, 28 Feb 2018 05:12:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbeB1NKz (ORCPT + 99 others); Wed, 28 Feb 2018 08:10:55 -0500 Received: from terminus.zytor.com ([198.137.202.136]:38713 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbeB1NKy (ORCPT ); Wed, 28 Feb 2018 08:10:54 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1SDAinp006168; Wed, 28 Feb 2018 05:10:44 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1SDAhr7006160; Wed, 28 Feb 2018 05:10:43 -0800 Date: Wed, 28 Feb 2018 05:10:43 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Baolin Wang Message-ID: Cc: linux-kernel@vger.kernel.org, baolin.wang@linaro.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de Reply-To: hpa@zytor.com, baolin.wang@linaro.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] clocksource: Use ATTRIBUTE_GROUPS Git-Commit-ID: 27263e8dc0f6fe27540a843611ec14a000591c41 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 27263e8dc0f6fe27540a843611ec14a000591c41 Gitweb: https://git.kernel.org/tip/27263e8dc0f6fe27540a843611ec14a000591c41 Author: Baolin Wang AuthorDate: Wed, 17 Jan 2018 14:01:30 +0800 Committer: Thomas Gleixner CommitDate: Wed, 28 Feb 2018 14:05:07 +0100 clocksource: Use ATTRIBUTE_GROUPS Use ATTRIBUTE_GROUPS instead of manually creating the individual device files. Signed-off-by: Baolin Wang Signed-off-by: Thomas Gleixner Cc: arnd@arndb.de Cc: sboyd@codeaurora.org Cc: broonie@kernel.org Cc: john.stultz@linaro.org Link: https://lkml.kernel.org/r/d80dccb981dc2461781ebb8d71a32ccdc1b0e6f9.1516167691.git.baolin.wang@linaro.org --- kernel/time/clocksource.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 7ce53465782b..0e974cface0b 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -993,6 +993,14 @@ static ssize_t available_clocksource_show(struct device *dev, } static DEVICE_ATTR_RO(available_clocksource); +static struct attribute *clocksource_attrs[] = { + &dev_attr_current_clocksource.attr, + &dev_attr_unbind_clocksource.attr, + &dev_attr_available_clocksource.attr, + NULL +}; +ATTRIBUTE_GROUPS(clocksource); + static struct bus_type clocksource_subsys = { .name = "clocksource", .dev_name = "clocksource", @@ -1001,6 +1009,7 @@ static struct bus_type clocksource_subsys = { static struct device device_clocksource = { .id = 0, .bus = &clocksource_subsys, + .groups = clocksource_groups, }; static int __init init_clocksource_sysfs(void) @@ -1009,17 +1018,7 @@ static int __init init_clocksource_sysfs(void) if (!error) error = device_register(&device_clocksource); - if (!error) - error = device_create_file( - &device_clocksource, - &dev_attr_current_clocksource); - if (!error) - error = device_create_file(&device_clocksource, - &dev_attr_unbind_clocksource); - if (!error) - error = device_create_file( - &device_clocksource, - &dev_attr_available_clocksource); + return error; }