Received: by 10.223.185.116 with SMTP id b49csp6169041wrg; Wed, 28 Feb 2018 05:12:18 -0800 (PST) X-Google-Smtp-Source: AH8x225W9WLghOBTQ9xTD/jE/iDhqsJtgY2ZLF/t8XVSdqrSHv8cOBPdHGUM260tLErsd7cRUUTI X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr17742048plb.411.1519823538588; Wed, 28 Feb 2018 05:12:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519823538; cv=none; d=google.com; s=arc-20160816; b=Y81+guaNrcm9TD6TYZZxUO6PZoLIfE48V685uLZ1p8RfRMjrzOiuEBgVvL18W7k1hr J3GmlVhu1taOSOwtkWQohmpTmQKGRengpQfwdUcV1rizBfwqAtMuCdmAyA9uHIgaiXOG QqrMa0Ly3oKqF6DAc+v83jAr5KbtnfkPAwqGH/rODGXOWRkgCyM9KbpyNn10dSAup9n/ 10aDFdtVQDt2jNsTb1Hqtens4D+oqF52JXS89PTfGJ7rqfgcMFmpC2kX3R0T1jagDv/1 b6NFLwrWl3Lu6WJpF4ZYEEAiM5fDTLYRLka7OSJ0eCMAtiQDh9SfwUdm4AsSYd8odIiw c4SA== 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=Iq8LPEnV4jfQ+2PpiQ/U7Z7xkE2Hvzqy++GZsspyRPs=; b=pgKGUBkuC9hzOxJSHY3lwIEtTxwDh7H5JthjlKb1hCMtNMrN7cr3TAX8QvNz4mKQrj 8uY/I6nBnijLoiYkRGJcOFKuK7xdcStN8pRf/8Hvgs4ngqtKwGZvwB2DDj0qpWZYthfU UgqXwm7uji3KogtmuzWSL2tMmwwguAKGSz50Y2OLIuATsq9Qs7PheI5Bi0hZWL9BZCKC 6TMxYrSjxag4Kopf+kCDXk+JsX8uKKaPfnijV0ywDTrHUSW7uvxZugIWnLC2dfggJ8LA VZ37y/hYyXYg2VzIGBSp2GRVnpp594sPbjZnSmFHPTgDXZ4Ub3alQS48QNBFqlZI1k8G 4UDw== 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 t2-v6si1264805plq.802.2018.02.28.05.12.03; Wed, 28 Feb 2018 05:12:18 -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 S1752625AbeB1NKX (ORCPT + 99 others); Wed, 28 Feb 2018 08:10:23 -0500 Received: from terminus.zytor.com ([198.137.202.136]:40685 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229AbeB1NKW (ORCPT ); Wed, 28 Feb 2018 08:10:22 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1SDAG8o006129; Wed, 28 Feb 2018 05:10:16 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1SDAGl7006126; Wed, 28 Feb 2018 05:10:16 -0800 Date: Wed, 28 Feb 2018 05:10:16 -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: baolin.wang@linaro.org, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: baolin.wang@linaro.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <8f35c77e753e957b61187e8e7b2e4a3d61e4a72b.1516167691.git.baolin.wang@linaro.org> References: <8f35c77e753e957b61187e8e7b2e4a3d61e4a72b.1516167691.git.baolin.wang@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] clocksource: Use DEVICE_ATTR_RW/RO/WO to define device attributes Git-Commit-ID: e87821d18cf4db19d634a04061c0a1b7eb9c0e65 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: e87821d18cf4db19d634a04061c0a1b7eb9c0e65 Gitweb: https://git.kernel.org/tip/e87821d18cf4db19d634a04061c0a1b7eb9c0e65 Author: Baolin Wang AuthorDate: Wed, 17 Jan 2018 14:01:29 +0800 Committer: Thomas Gleixner CommitDate: Wed, 28 Feb 2018 14:04:52 +0100 clocksource: Use DEVICE_ATTR_RW/RO/WO to define device attributes Convert DEVICE_ATTR to DEVICE_ATTR_RW/RO/WO which is the preferred and simpler way of implementation. 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/8f35c77e753e957b61187e8e7b2e4a3d61e4a72b.1516167691.git.baolin.wang@linaro.org --- kernel/time/clocksource.c | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index c5fdcb13200f..7ce53465782b 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -857,16 +857,16 @@ EXPORT_SYMBOL(clocksource_unregister); #ifdef CONFIG_SYSFS /** - * sysfs_show_current_clocksources - sysfs interface for current clocksource + * current_clocksource_show - sysfs interface for current clocksource * @dev: unused * @attr: unused * @buf: char buffer to be filled with clocksource list * * Provides sysfs interface for listing current clocksource. */ -static ssize_t -sysfs_show_current_clocksources(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t current_clocksource_show(struct device *dev, + struct device_attribute *attr, + char *buf) { ssize_t count = 0; @@ -895,7 +895,7 @@ ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt) } /** - * sysfs_override_clocksource - interface for manually overriding clocksource + * current_clocksource_store - interface for manually overriding clocksource * @dev: unused * @attr: unused * @buf: name of override clocksource @@ -904,9 +904,9 @@ ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt) * Takes input from sysfs interface for manually overriding the default * clocksource selection. */ -static ssize_t sysfs_override_clocksource(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t current_clocksource_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { ssize_t ret; @@ -920,9 +920,10 @@ static ssize_t sysfs_override_clocksource(struct device *dev, return ret; } +static DEVICE_ATTR_RW(current_clocksource); /** - * sysfs_unbind_current_clocksource - interface for manually unbinding clocksource + * unbind_clocksource_store - interface for manually unbinding clocksource * @dev: unused * @attr: unused * @buf: unused @@ -930,7 +931,7 @@ static ssize_t sysfs_override_clocksource(struct device *dev, * * Takes input from sysfs interface for manually unbinding a clocksource. */ -static ssize_t sysfs_unbind_clocksource(struct device *dev, +static ssize_t unbind_clocksource_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -954,19 +955,19 @@ static ssize_t sysfs_unbind_clocksource(struct device *dev, return ret ? ret : count; } +static DEVICE_ATTR_WO(unbind_clocksource); /** - * sysfs_show_available_clocksources - sysfs interface for listing clocksource + * available_clocksource_show - sysfs interface for listing clocksource * @dev: unused * @attr: unused * @buf: char buffer to be filled with clocksource list * * Provides sysfs interface for listing registered clocksources */ -static ssize_t -sysfs_show_available_clocksources(struct device *dev, - struct device_attribute *attr, - char *buf) +static ssize_t available_clocksource_show(struct device *dev, + struct device_attribute *attr, + char *buf) { struct clocksource *src; ssize_t count = 0; @@ -990,17 +991,7 @@ sysfs_show_available_clocksources(struct device *dev, return count; } - -/* - * Sysfs setup bits: - */ -static DEVICE_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, - sysfs_override_clocksource); - -static DEVICE_ATTR(unbind_clocksource, 0200, NULL, sysfs_unbind_clocksource); - -static DEVICE_ATTR(available_clocksource, 0444, - sysfs_show_available_clocksources, NULL); +static DEVICE_ATTR_RO(available_clocksource); static struct bus_type clocksource_subsys = { .name = "clocksource",