From patchwork Wed Jun 17 15:09:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 190878 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp539329ilo; Wed, 17 Jun 2020 08:10:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnaOwzcOPgzSUU5lL7deTy4yiO1G6/7vTp2K/6oT24HUACkRD9GzI4ybt4zk8sNWqCZSWW X-Received: by 2002:a50:fb92:: with SMTP id e18mr7449057edq.135.1592406656035; Wed, 17 Jun 2020 08:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592406656; cv=none; d=google.com; s=arc-20160816; b=RUUlx/D8xjIVbyf2pSVp8IyeSFHVNLqX9+ZTsbOTF6VKuZ97rD+GjEltempf2/PGMP Tn6Vn3oHslxtkx0jpBMdnMmN4l1Y7vmPjth/tXW4PIVtrb6tDeK5oW1upNpbWaA9x4Nd Yc1ivxEdlmENigtFRyqUZZSGDUhs2691bWg2jDJy3pp1vPeJHzhNo+V2Up9pyQK00t4p giq+o/u5gJj5P1yr2Z/kADV0yZklB96ssrfpSvq0hwFTCfmea2Z7C/rpYaKhLKxH56v8 ZKiSTxGo6+mXJr80vlWO7pVlhg48FNGRxHkq+gYf3+D3PwkA/wL2B6+dKxxPErBXGp/R s9jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9rbi449bFmHQundQ8dlXaifDs/ndof179QCH2fsw94w=; b=dDfdPt+B+gfLCJzkfuqTHwW00aDUjhsl4BxOLrjgpMhSP0Ghh/JVheSA2LhVwhvqeX LaPNl4Q79O69t5i34rkIcEHVagzF2cBs5ubjs8bOgd38iQdhmzZOaefisfH+tKKM+quZ ur//1ulCG6Q4iiAcHxGyONMgAgs+d4uigsg4FSeXjTl/dDAtPATeMsMHswTtmfGPgtN2 FRJhdd2qDT7EPJgIKRvxYIp5I3EHWzMC67yrJ0BbwgtckxXDrMSTmi7/hbJ4k4cOgjtQ IvbA4ABX7KAsba5eoHqjkxX1bmWzigf9YzW6yPntBwrP0aAqvFgS6nMUuXT2Tk73pEgM v4vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=U1Ux5UkW; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du7si118386ejc.341.2020.06.17.08.10.55; Wed, 17 Jun 2020 08:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=U1Ux5UkW; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727782AbgFQPKy (ORCPT + 6 others); Wed, 17 Jun 2020 11:10:54 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:32914 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbgFQPKi (ORCPT ); Wed, 17 Jun 2020 11:10:38 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05HFAY3W117103; Wed, 17 Jun 2020 10:10:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1592406634; bh=9rbi449bFmHQundQ8dlXaifDs/ndof179QCH2fsw94w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=U1Ux5UkWyrzcnsjGMe1sMuzKSkQglXL1ZX79Wu9vSPEUKUX0ZCDp+rDcZ8motJwHb mA4nw1lzM/o1x7wozV2ALcsK3tT1lQWzILGdIHKuAqdrOTZtaqeSd0gU8h2XcdfavB QAUPyJ6zQgQz8VEguEX4Tpw9mOyJrmlfS26fzU5Y= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05HFAYZE110953 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Jun 2020 10:10:34 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 17 Jun 2020 10:10:34 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 17 Jun 2020 10:10:34 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 05HFAXkF107745; Wed, 17 Jun 2020 10:10:34 -0500 From: Dan Murphy To: , , CC: , , , Dan Murphy Subject: [PATCH v28 14/15] leds: lp55xx: Fix file permissions to use DEVICE_ATTR macros Date: Wed, 17 Jun 2020 10:09:23 -0500 Message-ID: <20200617150924.12665-15-dmurphy@ti.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200617150924.12665-1-dmurphy@ti.com> References: <20200617150924.12665-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Fix the checkpatch warnings for the use of the file permission macros. In converting the file permissions to the DEVICE_ATTR_XX macros the call back function names needed to be updated within the code. This means that the lp55xx_ needed to be dropped in the name to keep in harmony with the ABI documentation. Acked-by: Pavel Machek Acked-by: Jacek Anaszewski Signed-off-by: Dan Murphy --- drivers/leds/leds-lp55xx-common.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) -- 2.26.2 diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index d33564aef563..59c3234ba1d7 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -83,7 +83,7 @@ static int lp55xx_post_init_device(struct lp55xx_chip *chip) return cfg->post_init_device(chip); } -static ssize_t lp55xx_show_current(struct device *dev, +static ssize_t led_current_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -92,7 +92,7 @@ static ssize_t lp55xx_show_current(struct device *dev, return scnprintf(buf, PAGE_SIZE, "%d\n", led->led_current); } -static ssize_t lp55xx_store_current(struct device *dev, +static ssize_t led_current_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -116,7 +116,7 @@ static ssize_t lp55xx_store_current(struct device *dev, return len; } -static ssize_t lp55xx_show_max_current(struct device *dev, +static ssize_t max_current_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -125,9 +125,8 @@ static ssize_t lp55xx_show_max_current(struct device *dev, return scnprintf(buf, PAGE_SIZE, "%d\n", led->max_current); } -static DEVICE_ATTR(led_current, S_IRUGO | S_IWUSR, lp55xx_show_current, - lp55xx_store_current); -static DEVICE_ATTR(max_current, S_IRUGO , lp55xx_show_max_current, NULL); +static DEVICE_ATTR_RW(led_current); +static DEVICE_ATTR_RO(max_current); static struct attribute *lp55xx_led_attrs[] = { &dev_attr_led_current.attr, @@ -271,7 +270,7 @@ static int lp55xx_request_firmware(struct lp55xx_chip *chip) GFP_KERNEL, chip, lp55xx_firmware_loaded); } -static ssize_t lp55xx_show_engine_select(struct device *dev, +static ssize_t select_engine_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -281,7 +280,7 @@ static ssize_t lp55xx_show_engine_select(struct device *dev, return sprintf(buf, "%d\n", chip->engine_idx); } -static ssize_t lp55xx_store_engine_select(struct device *dev, +static ssize_t select_engine_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -323,7 +322,7 @@ static inline void lp55xx_run_engine(struct lp55xx_chip *chip, bool start) chip->cfg->run_engine(chip, start); } -static ssize_t lp55xx_store_engine_run(struct device *dev, +static ssize_t run_engine_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { @@ -348,9 +347,8 @@ static ssize_t lp55xx_store_engine_run(struct device *dev, return len; } -static DEVICE_ATTR(select_engine, S_IRUGO | S_IWUSR, - lp55xx_show_engine_select, lp55xx_store_engine_select); -static DEVICE_ATTR(run_engine, S_IWUSR, NULL, lp55xx_store_engine_run); +static DEVICE_ATTR_RW(select_engine); +static DEVICE_ATTR_WO(run_engine); static struct attribute *lp55xx_engine_attributes[] = { &dev_attr_select_engine.attr,