mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aishwarya Pant <aishpant@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Julia Lawall <julia.lawall@lip6.fr>, Joe Perches <joe@perches.com>
Subject: [PATCH 5/5] iio: trigger: sysfs: use permisssion specific variants of DEVICE_ATTR
Date: Thu, 4 Jan 2018 20:08:39 +0530	[thread overview]
Message-ID: <068e06d7a0a8081bb87698670543f9df8fd13c82.1515076155.git.aishpant@gmail.com> (raw)
In-Reply-To: <cover.1515076155.git.aishpant@gmail.com>

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 <aishpant@gmail.com>
---
 drivers/iio/trigger/iio-trig-sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
index 3f0dc9a1a514..281ed6602f35 100644
--- a/drivers/iio/trigger/iio-trig-sysfs.c
+++ b/drivers/iio/trigger/iio-trig-sysfs.c
@@ -99,7 +99,7 @@ static void iio_sysfs_trigger_work(struct irq_work *work)
 	iio_trigger_poll(trig->trig);
 }
 
-static ssize_t iio_sysfs_trigger_poll(struct device *dev,
+static ssize_t trigger_now_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct iio_trigger *trig = to_iio_trigger(dev);
@@ -110,7 +110,7 @@ static ssize_t iio_sysfs_trigger_poll(struct device *dev,
 	return count;
 }
 
-static DEVICE_ATTR(trigger_now, S_IWUSR, NULL, iio_sysfs_trigger_poll);
+static DEVICE_ATTR_WO(trigger_now);
 
 static struct attribute *iio_sysfs_trigger_attrs[] = {
 	&dev_attr_trigger_now.attr,
-- 
2.15.1

  parent reply	other threads:[~2018-01-04 14:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 14:36 [PATCH 0/5] iio: use permission " Aishwarya Pant
2018-01-04 14:37 ` [PATCH 1/5] iio: buffer: " Aishwarya Pant
2018-01-06 12:35   ` Jonathan Cameron
2018-01-06 12:50     ` Lars-Peter Clausen
2018-01-06 13:18       ` Julia Lawall
2018-01-06 14:17         ` Jonathan Cameron
2018-01-06 15:28     ` Joe Perches
2018-01-04 14:37 ` [PATCH 2/5] iio: core: " Aishwarya Pant
2018-01-04 14:38 ` [PATCH 3/5] iio: trigger: " Aishwarya Pant
2018-01-04 14:38 ` [PATCH 4/5] iio: hrtimer: " Aishwarya Pant
2018-01-04 14:38 ` Aishwarya Pant [this message]
2018-01-04 15:16 ` [PATCH 0/5] iio: " Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=068e06d7a0a8081bb87698670543f9df8fd13c82.1515076155.git.aishpant@gmail.com \
    --to=aishpant@gmail.com \
    --cc=jic23@kernel.org \
    --cc=joe@perches.com \
    --cc=julia.lawall@lip6.fr \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®