Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp509151pxj; Wed, 2 Jun 2021 04:58:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRXK4/i7eBMTi5xoStLXCgRl92H2wt+qivp33+Zr0FVpDZeztkitjvonCPbgkJMLmda14V X-Received: by 2002:aa7:cb90:: with SMTP id r16mr38457478edt.247.1622635082175; Wed, 02 Jun 2021 04:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622635082; cv=none; d=google.com; s=arc-20160816; b=kbs0DLolVsoAdSv2gi1LDFL5trbORSZ2it1+nlwVComgCrqQJOSUvrwkfeaT6p6D2K fIX9cZ920nJyTdidiTEI14OfIcjtBqqNVBFuVh2g5mmZVljr3vviCgKxX2TKy0X5pSPw 6Ag8TjhMe1DjAym1qx9A9p+7wfct4AlejVv7ue8UvovbIQIx9mEP1R82cVlAE2MkGoPL BafCUR/IvqJ9vApU1yghFfeLVHyCuNs83QWtP4fHoAw29AcFA9OHfS1e2oAKDP5r3Uhr GhfDm4+6ggo5AQQGlE2anTdpr0XNvja6Foa2xZK2PowumqD0Dx4Hf7sJC0198qZs6k9d 2ZvA== 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=cvN8ssbqPFgvuM0PlTd+8leFB2EiYJ1jTMVlE9PauGM=; b=m1MAjSzNxcjDni2ErrrHh2dbwTtxeU9NTuWQ+uDyDB33bUMLNZ9nurgcfVK1Hl7NUV ILxVIo5Au+cMPzapMv0fT23pAIueNUdw6ReMIwU9Z4vUq//oJWNoPtNvNaEqmYr4/vPw qXsgik2hV5yn2xuFAJqqG0l2a2Hn4TvzmGkvGjiX5c4b/A5NszsyGTb9STFEsj7Un63+ SvWhMAD9vZhSA48GAO8A9C6A90wqYWuHA/bni7MgcR53KHnaUT3QJPkT2ae8tzvQYj99 RZnGz5qAqwRRZmzY9evR9y/FWfFlaMX8DqH24lzMlfTfLZQxCsHiYKNvTz9Dxo4Xvlcx +r6Q== 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 s18si21688647eji.591.2021.06.02.04.57.39; Wed, 02 Jun 2021 04:58:02 -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 S229734AbhFBLpm (ORCPT + 99 others); Wed, 2 Jun 2021 07:45:42 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:7073 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbhFBLpk (ORCPT ); Wed, 2 Jun 2021 07:45:40 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fw6YM0bcqzYnpR; Wed, 2 Jun 2021 19:41:11 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv703-chm.china.huawei.com (10.3.19.46) 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:55 +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:55 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 1/9] mfd: wm831x: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:31 +0800 Message-ID: <20210602114339.11223-2-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_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/wm831x-otp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c index afe59d52dd74d55..25f5d9fe33a18e2 100644 --- a/drivers/mfd/wm831x-otp.c +++ b/drivers/mfd/wm831x-otp.c @@ -38,8 +38,8 @@ static int wm831x_unique_id_read(struct wm831x *wm831x, char *id) return 0; } -static ssize_t wm831x_unique_id_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t unique_id_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct wm831x *wm831x = dev_get_drvdata(dev); int rval; @@ -52,7 +52,7 @@ static ssize_t wm831x_unique_id_show(struct device *dev, return sprintf(buf, "%*phN\n", WM831X_UNIQUE_ID_LEN, id); } -static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL); +static DEVICE_ATTR_RO(unique_id); int wm831x_otp_init(struct wm831x *wm831x) { -- 2.26.0.106.g9fadedd