Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp274252pxj; Fri, 14 May 2021 03:10:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGUW97XoSPX9DF5vdbQOKT3Mj61YNwzhilLahceCpeIRd6jyeOkTDUVJx3K2SGM9IQgSER X-Received: by 2002:a05:6602:2596:: with SMTP id p22mr12547938ioo.184.1620987045964; Fri, 14 May 2021 03:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620987045; cv=none; d=google.com; s=arc-20160816; b=wMiz61NLdE+xqWwzY8MlxM6+JsbVEF7GmE3Ho54wSNQFc6BS6AOlRiwiZvcstV6TG3 hMwT0mb4EGAC8wVeleeJTSm13awx3ec2zN3qxHR7GT3DGSJAZftlAJmH7bwuBAWbogXo sgzDFYp1W606lCtTCu8Gcy5z3dOq7JnlSxAKZCu7p0HAHYAEdv73CZduDdMUPKKDmVNs 1FDi8V3ujq4IreJAF0Hs3ycLm8NGOT9o+pXhopNmrgkW20KKGnKuumx7CK5FDSgVYnty sq+OslSk3pq9Cm1Q2a5YyifB7zOwQBNEi4rnlo9FFzQsBZusVVLlz+aGvg2ybsWJilH2 mKXw== 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=nFGp4lKzh+3lNLxW/H6qr7Zkwj6xTmcsjD4qcNiiMv0=; b=jNZmGOQlE6Sunm/Nl0j8Sm2FSnOGiC5SVroWNCuZU0Mvj7r8KceF8SIbj4KNOzuGNm 24TAvPo0n2GqRsDt0KKXGvD25ZlVWF7DeVCDu5M2LxJ18JIwlh3nsLRjYDnvI0Dntk8i 8sEAg4v6ykCf82/s+tFGyzBQgHUjUThhhmQN5Ly3brbzauWiISn7dUnFWNUJ8lMncKBd djyI1FkkaLjJV0uSpzF54gDsCAkMEnmPJ/XwMUS8oNfPETPFBYpmxAbogV/REJ0wdd8A FsEb6Kv2cZV79fuIkkht1q3K8v6rt/XwDCDO10z+guyp89hOO3A6PhsLh2Pg6PQ4X9gd NqLw== 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 z13si639823ioi.0.2021.05.14.03.10.33; Fri, 14 May 2021 03:10:45 -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 S233242AbhENIM2 (ORCPT + 99 others); Fri, 14 May 2021 04:12:28 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2660 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbhENIM2 (ORCPT ); Fri, 14 May 2021 04:12:28 -0400 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: , , , , CC: , , YueHaibing 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 Content-Type: text/plain X-Originating-IP: [10.174.179.215] 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/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, -- 2.17.1