From patchwork Thu Jan 4 10:58:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aishwarya Pant X-Patchwork-Id: 10144459 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 18F0D601A1 for ; Thu, 4 Jan 2018 10:59:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E680B283BF for ; Thu, 4 Jan 2018 10:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB3F9283D1; Thu, 4 Jan 2018 10:59:00 +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 89A7D283BF for ; Thu, 4 Jan 2018 10:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752544AbeADK67 (ORCPT ); Thu, 4 Jan 2018 05:58:59 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:37641 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbeADK66 (ORCPT ); Thu, 4 Jan 2018 05:58:58 -0500 Received: by mail-it0-f65.google.com with SMTP id d137so1958107itc.2; Thu, 04 Jan 2018 02:58:58 -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:mime-version:content-disposition :user-agent; bh=hKqR8tJZEfsJVLSkXqoXv30Un7p73Twrio/PzztHvkI=; b=gv60/Q5kQvY7Az+GgOPp+dl90lj9TIVumdn1ApVQgr0eENXW5WrjVJ4RMfRMnkHIE5 lxGQTG5X3hjKH2FaDPc+YzLJiYP8mIC35014AUEEB4IRah1eoKCLp69j0QZIDPOw7b2J aEL5c5Y87L0xeLFpFB8UozX099dJHwkFikQ8USq2hZz0oa49bXqiasnvjvVB3JDR7SL1 rDTtygipbqZq6jBSNBogpw6wshRC+aVAajfHxMScHRpQlF3YskUZ+QKew7nwQ24B1bAP w4Z0+BmK/+spssrWogXr85VDFOTCT3hrun7pSYh5XKwlQOhOwtTzl3+p/VtH6vqFtKKh OntQ== 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:mime-version :content-disposition:user-agent; bh=hKqR8tJZEfsJVLSkXqoXv30Un7p73Twrio/PzztHvkI=; b=NNTsX2uexqquiG0MiD21RnfQc4LYOwcrw48amLgZ13sxUDohc7V0w7B8dZmCS8FD7Y +lXC3rqnLsN//zW8KVFtPnim5EqPLmMXcKatYdPwTxugJUof3nICQwLvVaMm3SBj5Sy8 3ymhT2QxSHusvvLFRA0v7SocJmqgtNYvX5LBpnm+DgZs85FPvUK6ba0N02QzunMXpMy+ TkY1QZf51vg/gLsNINte/vvYADNSyJ/GlP8DVjqxtD00KSY7EjkGlI0SKdUWnRNsWw6O UmlurN00g1Idsgu+KwwI1p52jFballPfrs+iRwAOV8VCqSVnnXuOJtjVECkcj+FKVQhU +AEw== X-Gm-Message-State: AKGB3mIZLFKtm068LFum/52rl7DiKo4Yn2NkenRPcCeLCl/EvxNT5+57 Bn27jg8H9W5rN8cOVDmMsWE= X-Google-Smtp-Source: ACJfBouKMtN64PJDoHZYW6dN4uPAq5c2pdSvM6sPdLdGCL48Xrb8YMdwKV1kU2uy6g0WOM6RRtwotw== X-Received: by 10.36.80.148 with SMTP id m142mr5405199itb.6.1515063537937; Thu, 04 Jan 2018 02:58:57 -0800 (PST) Received: from mordor.localdomain ([183.82.21.239]) by smtp.gmail.com with ESMTPSA id u128sm2020071itb.1.2018.01.04.02.58.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2018 02:58:57 -0800 (PST) Date: Thu, 4 Jan 2018 16:28:51 +0530 From: Aishwarya Pant To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Julia Lawall Subject: [PATCH] staging: iio: trigger: replace device_attr with device_attr_rw Message-ID: <20180104105851.GA10434@mordor.localdomain> MIME-Version: 1.0 Content-Disposition: inline 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_RW() macro for compaction and readability. Done using coccinelle. Signed-off-by: Aishwarya Pant --- drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c index f389f5cca99d..71f11d7472c0 100644 --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c @@ -78,9 +78,9 @@ static int iio_bfin_tmr_set_state(struct iio_trigger *trig, bool state) return 0; } -static ssize_t iio_bfin_tmr_frequency_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t frequency_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { struct iio_trigger *trig = to_iio_trigger(dev); struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); @@ -116,9 +116,9 @@ static ssize_t iio_bfin_tmr_frequency_store(struct device *dev, return count; } -static ssize_t iio_bfin_tmr_frequency_show(struct device *dev, - struct device_attribute *attr, - char *buf) +static ssize_t frequency_show(struct device *dev, + struct device_attribute *attr, + char *buf) { struct iio_trigger *trig = to_iio_trigger(dev); struct bfin_tmr_state *st = iio_trigger_get_drvdata(trig); @@ -133,8 +133,7 @@ static ssize_t iio_bfin_tmr_frequency_show(struct device *dev, return sprintf(buf, "%lu\n", val); } -static DEVICE_ATTR(frequency, 0644, iio_bfin_tmr_frequency_show, - iio_bfin_tmr_frequency_store); +static DEVICE_ATTR_RW(frequency); static struct attribute *iio_bfin_tmr_trigger_attrs[] = { &dev_attr_frequency.attr,