Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3350777pxj; Mon, 24 May 2021 04:52:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdBSzHINnsg0kyI5G2oInH5EBgQYcnjo6Qns5Yr6YDTkQT/bIWW5xYE9qferUk6qw089G1 X-Received: by 2002:a05:6638:13c4:: with SMTP id i4mr24427922jaj.37.1621857168826; Mon, 24 May 2021 04:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621857168; cv=none; d=google.com; s=arc-20160816; b=zk7lqTlOV1Phb1bSzatFKIloiSpwKJr0+UOGFe8o3mYXdyMIRvwZrF1estHuQgcfmk qt5hi9j3JtfPitEFdB2kSa6sQ3phYMLLNbFbBqYTMAFEl5+K/bV0tWz9bVjac7DLfWku OzXEK3dWIsVIHFOdyALG2oB+rn/vcjcbZbbkLOV+coebLFz66p8vXxDiKn2cLmg+TiB4 E+dK99vGxIgrE8JAIcliHT++TNGLDyHvGzLde01XzYdkZn/V/ht3Z0aU/qV2JFA4D51P PKERFLLFTt07050rhWE7SKABkyxFURAL3QQDxMnfgHhnWrAkir6Q340ZftgI/7ncc3ZE T1ZQ== 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=o2rfxC+GLAQUiO4JVLR4A18IZKZGSXjLZ6tvjWR0yp8=; b=CPgVTBKmSE+4nb8n0ZV55eql7ou+u0sinn2bwVcPmcnA2IhG2lHVuC2el+Wfnoqz1v CxSXTGuflA8m/MLUq6qiMTevbE+/G3Zs30c4V1+SKgzrd5ayeH3aPbhAMKBEXZUOKLkq +ULlm59VcGuNBAkP02M1b4sPjC08GJIZqUfGtWLbYVgF7YkpkGNaD0qQ5DYPniKJLTYK MI+ZAYQaWpFHo92XHBbcEW8V4Xu/aoi5mAVrN0HwxE5uheuZCPyND6azQPj1orLwqk8h yA9YFVqbWFQyta1kp91guK1OJRcW6p2JLNOJkc7CZ/ZzZxgiVvElvx8J9b3FvD2ChI11 0p0g== 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 h6si12436757jaj.29.2021.05.24.04.52.36; Mon, 24 May 2021 04:52:48 -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 S232591AbhEXLxC (ORCPT + 99 others); Mon, 24 May 2021 07:53:02 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5538 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232494AbhEXLxC (ORCPT ); Mon, 24 May 2021 07:53:02 -0400 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fpb8B3V35zwSqY; Mon, 24 May 2021 19:48:42 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems704-chm.china.huawei.com (10.3.19.181) 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:51:32 +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:51:32 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH -next] ASoC: tlv320aic26: use DEVICE_ATTR_RW macro Date: Mon, 24 May 2021 19:51:31 +0800 Message-ID: <20210524115131.46288-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: dggems705-chm.china.huawei.com (10.3.19.182) 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_RW() helper instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing --- sound/soc/codecs/tlv320aic26.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index c7baef8948d4..077415a57225 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c @@ -261,8 +261,8 @@ static const struct snd_kcontrol_new aic26_snd_controls[] = { * SPI device portion of driver: sysfs files for debugging */ -static ssize_t aic26_keyclick_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t keyclick_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct aic26 *aic26 = dev_get_drvdata(dev); int val, amp, freq, len; @@ -276,9 +276,9 @@ static ssize_t aic26_keyclick_show(struct device *dev, } /* Any write to the keyclick attribute will trigger the keyclick event */ -static ssize_t aic26_keyclick_set(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t keyclick_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { struct aic26 *aic26 = dev_get_drvdata(dev); @@ -288,7 +288,7 @@ static ssize_t aic26_keyclick_set(struct device *dev, return count; } -static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set); +static DEVICE_ATTR_RW(keyclick); /* --------------------------------------------------------------------- * SoC CODEC portion of driver: probe and release routines -- 2.17.1