Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp509602pxj; Wed, 2 Jun 2021 04:58:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyTpbZp94sc3G0T5jmK8pRvHpYN0pmteC00Hi8FusCaoZFzPURTkvjVMpjgkVvGY9AM0no X-Received: by 2002:a6b:8d0c:: with SMTP id p12mr9464764iod.120.1622635131963; Wed, 02 Jun 2021 04:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622635131; cv=none; d=google.com; s=arc-20160816; b=iAbQUcFBd/1PTthnJEhxA/huo/nOxgI0C2ycHhxyGO9u09Og+AC7DbzzHyt65kDy5z jrju4XoxeCHFHfQF86lKbh11JHis629cT43a+zQIgaJQsJh1bufA6frkE5met6PIOtod dRk/8dVsRDlYIeOewwNpW5/QczfSHNJMEnJWpuLXPakEGotrhHVI7KMxDMYUO/NGCTaA i5yDp5/1nOFg5ThwpPKllGHKyMxZ6PIjQs2nhrRtFy0yqe121iokLEP+QgES7Fblm+g9 loJ4ZlA17T9YVTCBDd+yIevEVIMP06DcmTi27Gj8hthmrWiuDjmMrHR6il58C/7VLNvO 4LpA== 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=Qnl6asdjJvsAByhF5XipCYA8SniYqiHZQ39w7qYwgeY=; b=pnVCpGAl7hWsiIt4qfQAjkSaO0AYsiJpxUsCPvbU8LqR5xBFh7HAxYsV3ehabxwSHJ gU0OSW/V9vySutFfR85ft/v9Vo901wbCL1P5TZAa0OnWfM40wuA/aPhiSTYYUbt9WuBS WmmUhjVSytKNc1sSi00nJHbKw5jgnZovFWhDV8IZ3E7wfb3NiA1KrTVVGIAfJEhXYGOc cMyge0yotdUfWmSGg6CsRYxv7wEKV6tkNq1rrBhCqKjQgip7ysqbEyXoxNNyLkFIzUPZ lFR47snmk59JmYzf4FvkofuJ4Xvg58v76DUiwbZ4qRTYLE2CqFw6QMrhbUqDSECHW5lH RiCw== 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 s4si23044386ilv.33.2021.06.02.04.58.39; Wed, 02 Jun 2021 04:58:51 -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 S229849AbhFBLpz (ORCPT + 99 others); Wed, 2 Jun 2021 07:45:55 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2963 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhFBLpl (ORCPT ); Wed, 2 Jun 2021 07:45:41 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fw6Y73Bl5z68nS; Wed, 2 Jun 2021 19:40:59 +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:57 +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:56 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 5/9] mfd: pcf50633: use DEVICE_ATTR_ADMIN_RO macro Date: Wed, 2 Jun 2021 19:43:35 +0800 Message-ID: <20210602114339.11223-6-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_RO 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/pcf50633-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 148bcd6120f45a3..e9c565cf0f54f29 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -77,8 +77,8 @@ int pcf50633_reg_clear_bits(struct pcf50633 *pcf, u8 reg, u8 val) EXPORT_SYMBOL_GPL(pcf50633_reg_clear_bits); /* sysfs attributes */ -static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, - char *buf) +static ssize_t dump_regs_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct pcf50633 *pcf = dev_get_drvdata(dev); u8 dump[16]; @@ -106,10 +106,10 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr, return buf1 - buf; } -static DEVICE_ATTR(dump_regs, 0400, show_dump_regs, NULL); +static DEVICE_ATTR_ADMIN_RO(dump_regs); -static ssize_t show_resume_reason(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t resume_reason_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct pcf50633 *pcf = dev_get_drvdata(dev); int n; @@ -123,7 +123,7 @@ static ssize_t show_resume_reason(struct device *dev, return n; } -static DEVICE_ATTR(resume_reason, 0400, show_resume_reason, NULL); +static DEVICE_ATTR_ADMIN_RO(resume_reason); static struct attribute *pcf_sysfs_entries[] = { &dev_attr_dump_regs.attr, -- 2.26.0.106.g9fadedd