From patchwork Thu Jan 4 14:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aishwarya Pant X-Patchwork-Id: 10144819 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 B7DE6601A1 for ; Thu, 4 Jan 2018 14:39:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA39D286B7 for ; Thu, 4 Jan 2018 14:39:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F199286BE; Thu, 4 Jan 2018 14:39:07 +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 0B1E0286C0 for ; Thu, 4 Jan 2018 14:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbeADOis (ORCPT ); Thu, 4 Jan 2018 09:38:48 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:41619 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753180AbeADOiq (ORCPT ); Thu, 4 Jan 2018 09:38:46 -0500 Received: by mail-pf0-f194.google.com with SMTP id j28so828651pfk.8; Thu, 04 Jan 2018 06:38:46 -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=2RKMxtWqvK/91+gTOXyBn086TjbLk/P8Zuyf+X49M8E=; b=QYTj88IQP17wIMi+beGNRI1OkmYkIZUKWbt93+f87OMi9BFaxFiK1Sey0XzUloKLca VCOnU4Xq7CovWnM2N5SU77UmmNj41RhY2n0MAUCKx+Y+tRTco9ilqwQD4CDn6s7DQ95y +lqPmB52kpxqEsdIheQUVjT5PcNbBI6GORNWnBJ04jVmK+e6Edfa6B8XD+NvBpLbqIQE g7jUNJ5hiVfYf0/VQpxGTcIQAJjRmJwVqOA9GDaAX1qpsHvMK4I8FUgz0yU3U+PNKGsy 5RG4gKM46LNJobEju+B5MDpMvhJe9XH6udpE5MvqdHVBRPnWQU+l4Llbs4KMxLPk+y9R +qlw== 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=2RKMxtWqvK/91+gTOXyBn086TjbLk/P8Zuyf+X49M8E=; b=rwrXbD52b1WiV7PGV4VC/urQB5xGfDd6K9dCWmAp31FNK0/8p2JRhlUgk5MoAMLbGs +blCz5W/mg2No56Jt8p513hk/AhRJduvqtSiop7rzD25diPqUt5e+ad2vmCJkWGqN+0f GtdOA7Qwu0OU+1T0QuzrmbWMPef5plGhbQORRB1OqaKxyXOqbIqTDrG7uNKcFspGc4/5 IKopeQ7WWA95+GHHkj67XhYvDHAnUjXSyOhu3MzZ4z4IyyJDtajEaXLA/3CbumcSND2h 6Y+47Fib2UdW+tLlq5a7nO8ch34mNfj9mPIf5QQkmWswKMoR8W3oDOcD6EU3fpCN7VQJ C7ug== X-Gm-Message-State: AKGB3mKKACNE+MxzZbNNgGB1K3j0PIDE18kDl7TMa5p4Y1POnNbL9Ppg RWjzIIUDM3EG6DZv3FHv3hPALg== X-Google-Smtp-Source: ACJfBouQDLywVgmCQk+GohvnTYbxdjIlLdpFeYRTqL6g4Wlpbg+3xxb2wTUgH2UfNX7DILel3Gwh5w== X-Received: by 10.99.110.13 with SMTP id j13mr4265858pgc.446.1515076725998; Thu, 04 Jan 2018 06:38:45 -0800 (PST) Received: from mordor.localdomain ([183.82.21.239]) by smtp.gmail.com with ESMTPSA id q15sm6859395pgt.12.2018.01.04.06.38.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2018 06:38:45 -0800 (PST) Date: Thu, 4 Jan 2018 20:08:39 +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 5/5] iio: trigger: sysfs: use permisssion specific variants of DEVICE_ATTR Message-ID: <068e06d7a0a8081bb87698670543f9df8fd13c82.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-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,