From patchwork Fri May 14 08:11:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 12257235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0675EC433B4 for ; Fri, 14 May 2021 08:12:23 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D0366144F for ; Fri, 14 May 2021 08:12:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D0366144F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 056711728; Fri, 14 May 2021 10:11:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 056711728 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1620979939; bh=BN/Vbhxq5Tt4Ff3nMxrL0shT/uEybuHxAT/QUq1/+s0=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=KIANp0V9piy9HmGqsIRuhf5cIQlJSgbK2Ug4k9dS6T0s/ITCp7kFqv6x8FaUietOk ldv3KjcsABRHD6o8U3da9CnF6l+IPeWAuFrWE7yNYxo1b0D5qnKwnkkuPJabbQxcK3 dtGD/sL4IgKysQDtqxN7aIMDBCfa8Meglp0imzBs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8FD7AF8020C; Fri, 14 May 2021 10:11:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9AD12F80240; Fri, 14 May 2021 10:11:26 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DB125F800BF for ; Fri, 14 May 2021 10:11:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DB125F800BF Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FhLjy6nhKzQnLT; Fri, 14 May 2021 16:07:50 +0800 (CST) Received: from localhost (10.174.179.215) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Fri, 14 May 2021 16:11:05 +0800 From: YueHaibing To: , , , , Subject: [PATCH -next] ASoC: soc-core: use DEVICE_ATTR_RO macro Date: Fri, 14 May 2021 16:11:00 +0800 Message-ID: <20210514081100.16196-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.215] X-CFilter-Loop: Reflected Cc: alsa-devel@alsa-project.org, YueHaibing , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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/soc-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1c0904acb935..2d969e31f37d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -75,9 +75,9 @@ static ssize_t pmdown_time_show(struct device *dev, return sprintf(buf, "%ld\n", rtd->pmdown_time); } -static ssize_t pmdown_time_set(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t pmdown_time_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev); int ret; @@ -89,7 +89,7 @@ static ssize_t pmdown_time_set(struct device *dev, return count; } -static DEVICE_ATTR(pmdown_time, 0644, pmdown_time_show, pmdown_time_set); +static DEVICE_ATTR_RW(pmdown_time); static struct attribute *soc_dev_attrs[] = { &dev_attr_pmdown_time.attr,