Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp509328pxj; Wed, 2 Jun 2021 04:58:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZiBlMyuAmSKlzWXoEA+CsH48kjTnasWAj+o0yZWKRUm6PQSjKBrlUy7f1MYN2rqXqpAI1 X-Received: by 2002:a05:6402:1777:: with SMTP id da23mr5407765edb.181.1622635100121; Wed, 02 Jun 2021 04:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622635100; cv=none; d=google.com; s=arc-20160816; b=dYhcp4T4sEcmkXvPmpVBOrN5cN+f392DVftD2EdIKigimm7L0M8XurAwCyHiMzNYw/ l138cZwMUwY0p/T5fzmam0ieP8ehBGfCRl/c12APQ8iLrkkvcO6Z6Z7fV/pclLLGcWq/ DxXSd9WEU/23rSmpcbloziI2Z7WYA4NZMOCUhFrCtVVio4m/trJgp+F1k23wxix5AcJZ 7C+wrFa1d9kEOmsIX2NecLIzhPTE+pTPQiZgVKDCTtg5mm+5hrlg6fjL4/IyBsGQJwym a2Uq51sSOuEC3KBhFKfPxUlul84GrV6FfEAj2OAmNVmLRIBxhSNaPzGTLYv8s0VsUF4/ AamQ== 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=BiXM25mvKhFJdP0+2DHCqvA9PGNvxCeBD8XN4W8US5Y=; b=rK69jxsASNo5oBHBdYbW5S3zMSE/8TeJR+SaPSgJ4FxEfVav2oJLh1WJ1fbAv//4Wd Z6Hn487o+cdUF+bqIUPjAKnhDdC1e0zykbJ/nTMIA0bJy29sAKVypw5xCq94uL+jOROW F1OFeiCsPi1s5SdHSdvCEA7WXmDoyiODYGmUUSSBNod9WgWTn6YC389W8f9B3zHtOVZu bP79f0Sp0zCHpKGZLgAk8HVLYapQqzKzPPo3D9j+KPFd46nC2aPwTg9GdpXHhgn9uyZi u2CBQBaphQ//6sJsuXa/mztwsqY+7JsETUb4E+TTVZXdYmcfmt+uRkoPn56O7vOhnE7p tSVA== 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 b6si2031991edq.133.2021.06.02.04.57.57; Wed, 02 Jun 2021 04:58:20 -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 S229894AbhFBLp6 (ORCPT + 99 others); Wed, 2 Jun 2021 07:45:58 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2964 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhFBLpm (ORCPT ); Wed, 2 Jun 2021 07:45:42 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fw6Y82VBKz68x9; Wed, 2 Jun 2021 19:41:00 +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: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:57 +0800 From: Zhen Lei To: Lee Jones , patches , linux-arm-kernel , linux-kernel CC: Zhen Lei Subject: [PATCH 7/9] mfd: janz-cmodio: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 19:43:37 +0800 Message-ID: <20210602114339.11223-8-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/janz-cmodio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c index 3df4e9a2998f490..70eba4ce496faa3 100644 --- a/drivers/mfd/janz-cmodio.c +++ b/drivers/mfd/janz-cmodio.c @@ -149,15 +149,15 @@ static int cmodio_probe_submodules(struct cmodio_device *priv) * SYSFS Attributes */ -static ssize_t mbus_show(struct device *dev, struct device_attribute *attr, - char *buf) +static ssize_t modulbus_number_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct cmodio_device *priv = dev_get_drvdata(dev); return snprintf(buf, PAGE_SIZE, "%x\n", priv->hex); } -static DEVICE_ATTR(modulbus_number, S_IRUGO, mbus_show, NULL); +static DEVICE_ATTR_RO(modulbus_number); static struct attribute *cmodio_sysfs_attrs[] = { &dev_attr_modulbus_number.attr, -- 2.26.0.106.g9fadedd