Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3343521pxj; Mon, 24 May 2021 04:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOkDTMJAky+KqjzCV1Tbe2qSqKepmlVe87BOMwXLClbG+Q+imJWDiRnPTkN6FAZFsPGSGb X-Received: by 2002:a05:6402:430b:: with SMTP id m11mr7402297edc.31.1621856517243; Mon, 24 May 2021 04:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621856517; cv=none; d=google.com; s=arc-20160816; b=hY4+EbmITG2OhLUPoduuPFz33AUCXbbEvm92NTM598O/P3tYLzEbBFM9CVsYpkllGW I/0Su90VcLAxFtOjgjqHI4HbOOnL7v7H8sdzz2kpytvbjPrq1SHeH8wZQyeB0j7HKfsE eVFa8qct6L9lIV3hI4q6jl19PzmIq6rFCLE1hphYx5It9Yv7g7QEgRVifxfBeIlmUT6Z yKy4SDs6Z1YjGRE46XMyf+fTcO0/+nPgQaiG6h9CxtocTpgpuskZUmQf/tEggnI9u7NT 1fea2YhBKUXaryt2m92cCTCuPNX1uZaicEgviYQPt9849Y6f2WFTmhvaTQht2CP/Ew2F i7Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=rYtIKyFAlI30MS7AlPj2iPlICBK+NlDcKcg+IHljgCs=; b=De7Yw4S2fEVYkGS5PoHTzANeyN3RE+UEkod1LiNlwWmSiQRboOpaSIFf7HGIhKa7nw aeCvU3JNWR6zoSkrMw9/gFsB107W0KnlypbbonN9ETr41j5bYS9Nm30P8gJWd2ZMN2Vx 8vaEqL6RnIcX6CjxfVvkfcYCxjF5JWm5idTVjbqf7BSlkUs3KBAbpTcuXKBoYHj1dZ1n K0NKChLiDJuJdBjHvaJD0Yg/J5n218EVDAS58vUCFuQwZXqKvizqV+fGJbzIiVqq9OOx SqqQB+IoPokq3y087R9/iwUuv1DETt5oh/6T0C1vRfnPaVM1g27Nv9eAsPROiEUOml1R X0RQ== 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 a22si12728352eje.230.2021.05.24.04.41.33; Mon, 24 May 2021 04:41:57 -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 S232606AbhEXLmJ (ORCPT + 99 others); Mon, 24 May 2021 07:42:09 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3647 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232110AbhEXLmI (ORCPT ); Mon, 24 May 2021 07:42:08 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpZtm1CDYzNydt; Mon, 24 May 2021 19:37:04 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 19:40:39 +0800 Received: from localhost (10.174.179.215) by dggema769-chm.china.huawei.com (10.1.198.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 19:40:39 +0800 From: YueHaibing To: , , , , , CC: , , , YueHaibing Subject: [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro Date: Mon, 24 May 2021 19:40:17 +0800 Message-ID: <20210524114017.18672-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggema769-chm.china.huawei.com (10.1.198.211) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing --- sound/soc/codecs/cs43130.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index de7fa3e4bfbb..44b20c1ef851 100644 --- a/sound/soc/codecs/cs43130.c +++ b/sound/soc/codecs/cs43130.c @@ -1672,14 +1672,14 @@ static int cs43130_show_dc(struct device *dev, char *buf, u8 ch) cs43130->hpload_dc[ch]); } -static ssize_t cs43130_show_dc_l(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t hpload_dc_l_show(struct device *dev, + struct device_attribute *attr, char *buf) { return cs43130_show_dc(dev, buf, HP_LEFT); } -static ssize_t cs43130_show_dc_r(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t hpload_dc_r_show(struct device *dev, + struct device_attribute *attr, char *buf) { return cs43130_show_dc(dev, buf, HP_RIGHT); } @@ -1719,22 +1719,22 @@ static int cs43130_show_ac(struct device *dev, char *buf, u8 ch) } } -static ssize_t cs43130_show_ac_l(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t hpload_ac_l_show(struct device *dev, + struct device_attribute *attr, char *buf) { return cs43130_show_ac(dev, buf, HP_LEFT); } -static ssize_t cs43130_show_ac_r(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t hpload_ac_r_show(struct device *dev, + struct device_attribute *attr, char *buf) { return cs43130_show_ac(dev, buf, HP_RIGHT); } -static DEVICE_ATTR(hpload_dc_l, 0444, cs43130_show_dc_l, NULL); -static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL); -static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL); -static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL); +static DEVICE_ATTR_RO(hpload_dc_l); +static DEVICE_ATTR_RO(hpload_dc_r); +static DEVICE_ATTR_RO(hpload_ac_l); +static DEVICE_ATTR_RO(hpload_ac_r); static struct attribute *hpload_attrs[] = { &dev_attr_hpload_dc_l.attr, -- 2.17.1