From patchwork Mon Jun 22 18:59:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 191370 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp422012ecs; Mon, 22 Jun 2020 11:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS28iIhJ7RH26q/3/ZERosFInHcunJvVm8bjRlBj2AQMCkv+LfPc5ll9Us6T/JocFBnfIb X-Received: by 2002:aa7:c38f:: with SMTP id k15mr19059520edq.342.1592852387789; Mon, 22 Jun 2020 11:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592852387; cv=none; d=google.com; s=arc-20160816; b=z1eHFJqztJyHg7apUuvus8Aik8siMMzNGi+Mlbz+L2jRISfHuoi1oBKyaNYnSGqCsf p7jMBqgQfwqcRJNf+aeHchWyMomMd3rkX2P65pJxeB22Gfh5rlbYfbmDyLDICTKSULNA BlN/1zikyVNa7/PA+VBdNaqrNFNETdnx/fCaCUBJ3MlySO6qSg16HRIDAZ08ShdYwpls NRwh9lqRqMRcE8b37t/g0KDCXUW2OlfuhmFS465GaC1nHHeO7WB7gDWoaV13dPXiua5c jsBOzukHy5+SYFdGihUfgPh1yrclohfdky9bGgSezOxl9hauF/QK0kBZt4/8MPZ2WAS0 N44Q== 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=iAO4CwTtee0Hj9LU19D2yWdNCj1Fm+Wnoffq/qU9XO0cnSwew5187HrlVzstrKa24/ Boo0ey6/FoL+dQs/bWjm7h5aA2On+G23gUzZtvagdYkVuLq+I1VSaJCR2w2k8DK6rWYx QbbXiggR0Q44qKIcUjMNpoOvvGbanDOnBUYqOq8iUFQmVj3lUSLnbQKDugDwVlhJdNdz Go5ZAHLeygii070KHtnhSNPiRoJUkGLPzzBhQ91ES0lwN4YrRiTnMnz5+Cex5LRkFErL MpE5YGdrhx9/pEY1KFH8/xwYpL6izn0FXl4Ix5TNp/7XWZc/4jH2aMwz80ee4R+7/o8Y pt4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Zt6mwbyw; 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 t3si9376855edr.560.2020.06.22.11.59.47; Mon, 22 Jun 2020 11:59:47 -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=Zt6mwbyw; 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 S1730432AbgFVS7q (ORCPT + 6 others); Mon, 22 Jun 2020 14:59:46 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60942 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730416AbgFVS7o (ORCPT ); Mon, 22 Jun 2020 14:59:44 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 05MIxWjK053537; Mon, 22 Jun 2020 13:59:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1592852372; bh=9rbi449bFmHQundQ8dlXaifDs/ndof179QCH2fsw94w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Zt6mwbywt8/DxgUn594YhlVIt4rza/ACSG5n9E9qmLJZu2HrowFRmDPU8zfUaNmyP FOQASu8kbRdv0uJURPzlZKyNfr/aIVGcpBOvqQN7gfHGiBdeBMZ1w4729qjUZSBtxv orMhq/gtRC/NMdsg0cojrAz2MjOniaBgrnl1/7n0= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 05MIxWqt010424 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 22 Jun 2020 13:59:32 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 22 Jun 2020 13:59:32 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE109.ent.ti.com (157.170.170.41) 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, 22 Jun 2020 13:59:31 -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 05MIxVNo078747; Mon, 22 Jun 2020 13:59:31 -0500 From: Dan Murphy To: , , CC: , , , , Dan Murphy Subject: [PATCH v29 15/16] leds: lp55xx: Fix file permissions to use DEVICE_ATTR macros Date: Mon, 22 Jun 2020 13:59:18 -0500 Message-ID: <20200622185919.2131-16-dmurphy@ti.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200622185919.2131-1-dmurphy@ti.com> References: <20200622185919.2131-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,