Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3344533pxj; Mon, 24 May 2021 04:43:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDSQGQCO8IOPfIA7TmT7kUMoEA0yFGW1+9mpI1cD2juEQK9gHSyeE5ozXjbehANo2zv3HA X-Received: by 2002:a02:aa85:: with SMTP id u5mr25575921jai.75.1621856615955; Mon, 24 May 2021 04:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621856615; cv=none; d=google.com; s=arc-20160816; b=QpZd+6rL5x4Wj+oBa3gaJwKwor2TkC7F7g5srxCJQW2HSiRtiowJtkE6Tpu5BP+7X1 mvWi2FcIIGrkJVsj5EWfAKqPT1FMl5cAgD9xbKwjv57ok6Q2GMooOBbcqO/zSu5ZwBeE YjceIXVeHjui0ZLn4ht6vEWT46iLN3ctDvQ2kafNa3Td5msZZtIhs0NtY37ZEE1hzukK KEcz8zhZKMCfinXGvn8tnHv+TwFCGwRZDeBVXpQRVfmlza2Cl0zraV8VjcKrEF+HlCen msSO19qq8mSq3HJlxDzri+Q3JASU4zb0HN0/5EqG0+NKkABOEXGTVkIdOKzZAVtSebqW +/tQ== 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=NNOdpmHsn+/uzzcLMAh6Nysm2gPGNcw8CM1BT4l+eYU=; b=ff48S/gHtVozkm0CtBnDH3CfTzk03tbvKVyO6+akaoy3pfJoFuHgGlMFOEBFmAuLCz uhbFF/GGX/M1Ah8QO3yHIpaYnljs8nN3rH/onjDXLqkFtWZ84+bVmIY8ubsntXHvGmcQ XteTVK5dL9Pj90wQ1cAMgdd74xj3HhlMZGZ/bAR1NxRzNDe1zxi+ZnNAl7ko732cV/Nt 4j0yPuPiZjvjSQz6e0iDefo1hxuO3e0paCxWYKYRoQIITQTN9ywv1GuD4Y15Wh790mWV k1D7TMl47bu2ZylOY2CJMf2rRPlfpjXWuC7SPPyPDjTQC/1KKRLqYeuGL4nnYu4FvuVN ttCg== 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 l11si15060873jah.65.2021.05.24.04.43.22; Mon, 24 May 2021 04:43:35 -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 S232706AbhEXLoN (ORCPT + 99 others); Mon, 24 May 2021 07:44:13 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3648 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbhEXLoN (ORCPT ); Mon, 24 May 2021 07:44:13 -0400 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpZx81gr0zNyZG; Mon, 24 May 2021 19:39:08 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems702-chm.china.huawei.com (10.3.19.179) 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:42:43 +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:42:43 +0800 From: YueHaibing To: , , , , , CC: , , , YueHaibing Subject: [PATCH -next] ASoC: cs42l52: use DEVICE_ATTR_WO macro Date: Mon, 24 May 2021 19:42:39 +0800 Message-ID: <20210524114239.7960-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: dggems703-chm.china.huawei.com (10.3.19.180) 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_WO() helper instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing --- sound/soc/codecs/cs42l52.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 88547e2cd53d..80161151b3f2 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -957,9 +957,8 @@ static int cs42l52_beep_event(struct input_dev *dev, unsigned int type, return 0; } -static ssize_t cs42l52_beep_set(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t beep_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct cs42l52_private *cs42l52 = dev_get_drvdata(dev); long int time; @@ -974,7 +973,7 @@ static ssize_t cs42l52_beep_set(struct device *dev, return count; } -static DEVICE_ATTR(beep, 0200, NULL, cs42l52_beep_set); +static DEVICE_ATTR_WO(beep); static void cs42l52_init_beep(struct snd_soc_component *component) { -- 2.17.1