From patchwork Mon Jul 13 15:45:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 235457 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2951151ilg; Mon, 13 Jul 2020 08:46:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBYB7vOEg+avcxYcCdUNgHzlkDy5rxLXDIphPpVdBPtXarcsu6/u8Ed22udoDSNjqvTYUB X-Received: by 2002:a17:906:6442:: with SMTP id l2mr318022ejn.383.1594655165799; Mon, 13 Jul 2020 08:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594655165; cv=none; d=google.com; s=arc-20160816; b=GXPm/LrZI5M8A9B1hph1psirILeGFNcR1Za8TnUyAJnNgjpl+L72BtDtcF0q1ZIy2m EpFMshJm2tJKoISyotboZy1el9P9Ix7v6STlmv1Mf7/GrdkOC6/ZzsZAZplVcqyPPaSe M3JhVBwUsj2R6OL2d27vz9pk8EWfnmrQ97b/Q9knTgTqeR8KBFBLkc83AmLrDvc/VGop JjzSBpjDVBhG4srUQfb/JQf6ZeTxvIbtEHcNaUfKuEomXZctvXXrWAmWlB+jmfzLZgjR gMlcxT31IktBCwj0bbTy7DNJe0hJD8TchoYunh1VzAXdV6bJ4MQUoVbSwz9pzNIMGG6N mT3Q== 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=fixhIkoPgG+a/gbgj4pHNFrof0wf1XPrapzgiwGlOI4=; b=ctftiwLmBnGYoq5P3y33qlrYlVB6duSWPw+5v4DFqEBLQxfbI3bDDe6XaounMlug8l VfatXM3iI4eemedA1Y+XrbNT2DMlQ/rLbonxfm51nDl28n40SsKL57cEsd/HB/4Ui2tA rLdC1zRr3+TMkxcllrAJ0RRudlSCPhUWVVlxdnNfvcp+wrNuShpMTwRM9t9IT4AAUeAM BVlLJJ5rZOjHuv8AHIh1u7njSerBY/JnQRy1naTIu8fPo6qpSuoVoQNnt/4jdAejfQ0k FmP2idEZfYFQFgizuNCHBLc3z/Mpf704QcG6guUFBLcDVGoAna3256o3q+RAVxXgXgMT ZCqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=i8DpPYeL; spf=pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-leds-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 d6si9855487edp.16.2020.07.13.08.46.05; Mon, 13 Jul 2020 08:46:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-leds-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=i8DpPYeL; spf=pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-leds-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 S1729644AbgGMPqF (ORCPT + 1 other); Mon, 13 Jul 2020 11:46:05 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:54978 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730029AbgGMPqF (ORCPT ); Mon, 13 Jul 2020 11:46:05 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06DFjpBd038963; Mon, 13 Jul 2020 10:45:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1594655151; bh=fixhIkoPgG+a/gbgj4pHNFrof0wf1XPrapzgiwGlOI4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=i8DpPYeLHkdKNBxOj6WzSlVWyn950+rFHFcfLi1/wG9WZQZ1UGzkrsfXrxu9tq4YL oZMwkOBawDE5aMBr5GhZONG+4FADkgDQDgAZaAVypF/YNATU2Iw9Gyr9F6ZshtZaZy nRUZHWLwjMTojSDcQufl+OuOUxLe92EsyZb+uHuo= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 06DFjpDv058308 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 13 Jul 2020 10:45:51 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 13 Jul 2020 10:45:51 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE106.ent.ti.com (157.170.170.36) 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, 13 Jul 2020 10:45:50 -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 06DFjooc032891; Mon, 13 Jul 2020 10:45:50 -0500 From: Dan Murphy To: , , , CC: , , , , Dan Murphy Subject: [PATCH v30 01/16] leds: lp55xx: Fix file permissions to use DEVICE_ATTR macros Date: Mon, 13 Jul 2020 10:45:29 -0500 Message-ID: <20200713154544.1683-2-dmurphy@ti.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200713154544.1683-1-dmurphy@ti.com> References: <20200713154544.1683-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@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.27.0 Reviewed-by: Marek BehĂșn diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 1354965ac866..3d0bc4dcd9f2 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -77,7 +77,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) { @@ -86,7 +86,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) { @@ -110,7 +110,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) { @@ -119,9 +119,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, @@ -224,7 +223,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) { @@ -234,7 +233,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) { @@ -276,7 +275,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) { @@ -301,9 +300,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,