Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753423AbeADOie (ORCPT + 1 other); Thu, 4 Jan 2018 09:38:34 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:42597 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753291AbeADOib (ORCPT ); Thu, 4 Jan 2018 09:38:31 -0500 X-Google-Smtp-Source: ACJfBosgfBUuOK2dEwrn55yfw57AVT2h7sgVzHCqPjsg8oNfGWQgRsfwYjc/NNsuUJVxte44JLyZZg== Date: Thu, 4 Jan 2018 20:08:24 +0530 From: Aishwarya Pant To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Julia Lawall , Joe Perches Subject: [PATCH 4/5] iio: hrtimer: use permission specific variants of DEVICE_ATTR Message-ID: <47783f7461de4a8f3487f97ced85bc98163c8b20.1515076155.git.aishpant@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: This is a clean-up patch which replaces DEVICE_ATTR macro with the file permission specific DEVICE_ATTR_{RO/WO/RW} macros for compaction and readability. Done using coccinelle. Signed-off-by: Aishwarya Pant --- drivers/iio/trigger/iio-trig-hrtimer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c index 7accd0187ba1..57e46669a5fb 100644 --- a/drivers/iio/trigger/iio-trig-hrtimer.c +++ b/drivers/iio/trigger/iio-trig-hrtimer.c @@ -35,7 +35,7 @@ static const struct config_item_type iio_hrtimer_type = { }; static -ssize_t iio_hrtimer_show_sampling_frequency(struct device *dev, +ssize_t sampling_frequency_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -46,7 +46,7 @@ ssize_t iio_hrtimer_show_sampling_frequency(struct device *dev, } static -ssize_t iio_hrtimer_store_sampling_frequency(struct device *dev, +ssize_t sampling_frequency_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -68,9 +68,7 @@ ssize_t iio_hrtimer_store_sampling_frequency(struct device *dev, return len; } -static DEVICE_ATTR(sampling_frequency, S_IRUGO | S_IWUSR, - iio_hrtimer_show_sampling_frequency, - iio_hrtimer_store_sampling_frequency); +static DEVICE_ATTR_RW(sampling_frequency); static struct attribute *iio_hrtimer_attrs[] = { &dev_attr_sampling_frequency.attr, -- 2.15.1