From patchwork Mon Jun 8 19:39:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 187617 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp5140982ilo; Mon, 8 Jun 2020 12:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP9O/cOJ/HTc/fk3tm4gMeEgLXah4/M7gb/mOWZLcqKxUnfiFZiqrJdAp4yt7jGMrXTyVo X-Received: by 2002:a17:906:3499:: with SMTP id g25mr21455480ejb.518.1591645239360; Mon, 08 Jun 2020 12:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591645239; cv=none; d=google.com; s=arc-20160816; b=zS01GFSAFBF9U4vQnvDHrcSZQnjbJpBJmNYezxxFWpdmSXgI8OIJZLRL7vdXAsgELW 3rm6Xr6I9dRAy8iPVVVv7iNgl/YTnTMZMU0XIft9sVJF5r8Y/6jEKeFk3Sn94k88B1B2 VYbnER1iXAITQClHOT8PEmfy/QUasMDxunh6KpAxa2m6s0KD7KtJUzmMFElKfzGXhl0/ xFiEeQk5piAx2oimizPMLY0a6zRNp92myVn8oLo4fl75yfAzPSYzFJ0XGH1zuoDOrSmR Sh9LCsxoS5WPzGAHjfudKJ0C5cY3bFfn+ckhqTQikVqFG9GRGo0LrtZvV5Mv0rEqPVe2 LAnA== 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=M6Ubkw5v3JRXmB3Vki1fuMTApG2Usy2RQyja5b7cXuMIb/ISO/i7iZZ0Ph5eyhcifR VSjd/U9is8M1I9CvutXwCWA72/SFHsElhC+NF+ba4FYtOJu31a+sf9+muOffSp/d0p/Q q1/ceY+maB3CTCVjh2mROUycwSNE93Iw1QG3Ve94esL/WH9CkBq1oFGN+VPPpA+F/5uX ywcaVuaZiG1b6lkLE7CDxcvoeV5s570X4v0llXVHQtt1O3RSgbyEGJeQeSWUb068WcvQ YHe24WyQspnBCfBa1CKgBQMD4c8t3woprH4h3bZMyUySZOf7zlzHGyxShaOXAdZmA/9I KUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uLrZLhlX; 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 b23si10061256edj.441.2020.06.08.12.40.39; Mon, 08 Jun 2020 12:40:39 -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=uLrZLhlX; 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 S1726774AbgFHTki (ORCPT + 6 others); Mon, 8 Jun 2020 15:40:38 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:35294 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbgFHTkg (ORCPT ); Mon, 8 Jun 2020 15:40:36 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 058JeWg5004377; Mon, 8 Jun 2020 14:40:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1591645232; bh=9rbi449bFmHQundQ8dlXaifDs/ndof179QCH2fsw94w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uLrZLhlXFfC3oCJvB0DeRvnctcxd7f/ejNN6IE8l9LnSV346DA66iKfEmeGRtzmYi H6eOhwiGcU3iYzJsbv0zQNNRd9fho2o81T07gyTqPLhlABnBHayLCey7+lqOqHkqOZ SeBNG2ooWw3LkazfFZGY1PP0p/6spL10rBjHmPHA= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 058JeWLK003626; Mon, 8 Jun 2020 14:40:32 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 8 Jun 2020 14:40:32 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE109.ent.ti.com (10.64.6.30) 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; Mon, 8 Jun 2020 14:40:32 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 058JeWkd057314; Mon, 8 Jun 2020 14:40:32 -0500 From: Dan Murphy To: , CC: , , , Dan Murphy Subject: [PATCH v27 14/15] leds: lp55xx: Fix file permissions to use DEVICE_ATTR macros Date: Mon, 8 Jun 2020 14:39:16 -0500 Message-ID: <20200608193917.13084-15-dmurphy@ti.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200608193917.13084-1-dmurphy@ti.com> References: <20200608193917.13084-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,