Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp569195pxj; Wed, 2 Jun 2021 06:18:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWiYLd2BqULtzrPf/CQ11EBR+uhLY2CFh8h0b9RlZZzl5UIr9T7cct4d6SwaB8a2ZZ2ZPr X-Received: by 2002:a17:906:b34e:: with SMTP id cd14mr10507944ejb.69.1622639903694; Wed, 02 Jun 2021 06:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622639903; cv=none; d=google.com; s=arc-20160816; b=NXq5IzegwdqyPvOF0Qs70Rq3xO7riR+2BsPSLrxBUNhY1HIvymYI0LuXZ4O1TbloL5 HZqqFYEzBzBvoMjq+6B8+P2FueCS0YyMtQ26j7qMBHACAVTpsvNf6DlLYUPgnr3j6k2W vE+qOexWRd8+N13QnUB0vOMHChB5cD/3tcYOJ/DnLXkdTR8lhOeK79K7q/+eyAKJsp2J aEEZeojIb/DNLGZoZlJvKSk4XGT+L7WTDssP0dGny3/Jads7Fo/xstUvkHElaSEH1Tzg mDITMxBg3ufttErahaO6CldUkAP2H5DEPhxkOJmCQwHAaZ7HnceyentYlficcGwh8Aq8 xziQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TWqtdECOpeT0lFot797TAZFvlQb2BxlGOM1MG3dYPPI=; b=QLh/LkgMp6NaH6p/ZsV9Ykd4lOz8omvzM2RhgDUJ6hJsPNQnhA6UAmvjOVV909jBXe KGPwfbVtojAFLc3eC9UcWGSO6jJB0rABaqFLhoP5g03qunf4CIcT+pQFdjkqXw3bkPIb HlqT9XTGJ5cScMotnUZBqvtit5qtVjN++sLZkcUUrIdC2Wdoqxdr+VKn/cc607nfgpGK J4ItKDsGge7FoLZDdhva5pUJq8Txsxe5susH1Q/+8Xh+Qwj9/ua/kFssaLTyHkGeC78m hiP54H+JBPoYzLsULZLBYr/DbuJTyoE1PAct/oXViS/UxciVzL+GNAajJW8sqX2wGz4H +Kgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh24si18435666ejb.194.2021.06.02.06.17.58; Wed, 02 Jun 2021 06:18:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229685AbhFBLqC (ORCPT + 99 others); Wed, 2 Jun 2021 07:46:02 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2851 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbhFBLpn (ORCPT ); Wed, 2 Jun 2021 07:45:43 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fw6W75b3xzWp49; Wed, 2 Jun 2021 19:39:15 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:58 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 19:43:58 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 8/9] mfd: intel_soc_pmic_bxtwc: use DEVICE_ATTR_ADMIN_RW macro Date: Wed, 2 Jun 2021 19:43:38 +0800 Message-ID: <20210602114339.11223-9-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210602114339.11223-1-thunder.leizhen@huawei.com> References: <20210602114339.11223-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEVICE_ATTR_ADMIN_RW macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/mfd/intel_soc_pmic_bxtwc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index 47d0d3a69a58a37..bc069c4daa60393 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -330,14 +330,14 @@ static int regmap_ipc_byte_reg_write(void *context, unsigned int reg, /* sysfs interfaces to r/w PMIC registers, required by initial script */ static unsigned long bxtwc_reg_addr; -static ssize_t bxtwc_reg_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t addr_show(struct device *dev, + struct device_attribute *attr, char *buf) { return sprintf(buf, "0x%lx\n", bxtwc_reg_addr); } -static ssize_t bxtwc_reg_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) +static ssize_t addr_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) { if (kstrtoul(buf, 0, &bxtwc_reg_addr)) { dev_err(dev, "Invalid register address\n"); @@ -346,8 +346,8 @@ static ssize_t bxtwc_reg_store(struct device *dev, return (ssize_t)count; } -static ssize_t bxtwc_val_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t val_show(struct device *dev, + struct device_attribute *attr, char *buf) { int ret; unsigned int val; @@ -362,8 +362,8 @@ static ssize_t bxtwc_val_show(struct device *dev, return sprintf(buf, "0x%02x\n", val); } -static ssize_t bxtwc_val_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) +static ssize_t val_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) { int ret; unsigned int val; @@ -382,8 +382,8 @@ static ssize_t bxtwc_val_store(struct device *dev, return count; } -static DEVICE_ATTR(addr, S_IWUSR | S_IRUSR, bxtwc_reg_show, bxtwc_reg_store); -static DEVICE_ATTR(val, S_IWUSR | S_IRUSR, bxtwc_val_show, bxtwc_val_store); +static DEVICE_ATTR_ADMIN_RW(addr); +static DEVICE_ATTR_ADMIN_RW(val); static struct attribute *bxtwc_attrs[] = { &dev_attr_addr.attr, &dev_attr_val.attr, -- 2.26.0.106.g9fadedd