From patchwork Thu Jan 4 14:38:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aishwarya Pant X-Patchwork-Id: 10144813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17062601A1 for ; Thu, 4 Jan 2018 14:38:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7073286B1 for ; Thu, 4 Jan 2018 14:38:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA58F286BA; Thu, 4 Jan 2018 14:38:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EF72286B1 for ; Thu, 4 Jan 2018 14:38:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753307AbeADOid (ORCPT ); Thu, 4 Jan 2018 09:38:33 -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 Received: by mail-pg0-f66.google.com with SMTP id q67so760847pga.9; Thu, 04 Jan 2018 06:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zSW/IAMQGg3iNijuNvzLkExHLXS6ftUJVXHTWsUgWbU=; b=ETs9Nt+hj/7xfAdECbnCJHz4l1BgCssCpNBJCj/kdNxYWHUhg4Dp9Taoky6Y/r8hS5 m67AQxlsW2S7VoJ2+iIXy9phYDWZc4NKsoqAeDXLXBW5TLLx1zpFjRUkES31nfur5S31 ZK9+IkjjAwfY2aVG6oz3TwUnUtrQppF/qT9BOBAt1dQ9yusTihOtthMz6XE0KJiWo54G XL37Uy8rvip8Dayi5t8YVyZC1+ZIiC9R23irTcL57dM9Anklsu1b7NOHJAa6JD/+9L9g Wn7u4Kh0Grs9954Dsy/pTv92jNgZbShS5P1Lys/n2iGAAy5H+QTpWSqjDYOXn3YHugLO S/8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zSW/IAMQGg3iNijuNvzLkExHLXS6ftUJVXHTWsUgWbU=; b=LkE2QzWk3zu+m1r2GmDRSnkyoFLcFzq9CHH1rVuiXfnWLigUiDyYCaeS+pHsIq/H1C 1MmNidc25Rm+nRHtizyeMYF4HbmH5bxOHgJrBrpt5Nxw7te0IRhUHjeIo+sKJleOQM1a zye1TqOOVzKu1jYi/f0hCr3x5Fs4b6fHhF48ek9SjZk5j+CO+ea0hzylivgSazEdBnFH 0Q8bdEXQvMIXUm+SWSucO1z9UOOSe4MCIlnlZlUHNa401Mg/IbISLIsnynDVVMqz+2yX 5Em89faxjr/j4Ctyf71j9ZQGpQ5WIJ/PEhyXfnwmRBqLsDG/FAa5LYQaw8HFioogUF7r UyIw== X-Gm-Message-State: AKGB3mLD+bsIGIgK/5NiTC5xxYrWdgcq0TI17x9T2ExqxuATE08Yo0PW FdPtQk65zVtz0FrS3bHed8o= X-Google-Smtp-Source: ACJfBosgfBUuOK2dEwrn55yfw57AVT2h7sgVzHCqPjsg8oNfGWQgRsfwYjc/NNsuUJVxte44JLyZZg== X-Received: by 10.98.205.204 with SMTP id o195mr4895446pfg.39.1515076710875; Thu, 04 Jan 2018 06:38:30 -0800 (PST) Received: from mordor.localdomain ([183.82.21.239]) by smtp.gmail.com with ESMTPSA id z22sm9489235pfl.135.2018.01.04.06.38.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2018 06:38:30 -0800 (PST) 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,