From patchwork Wed Jun 2 06:38:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 452479 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp301176jao; Tue, 1 Jun 2021 23:38:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcroItCstWaswYXVfv5j2jUXq2ydT/4g1j9yo7hSEd3j1G0RoQAr4apvGYbv/q4x9n+0H1 X-Received: by 2002:a92:cda7:: with SMTP id g7mr23349286ild.50.1622615921584; Tue, 01 Jun 2021 23:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622615921; cv=none; d=google.com; s=arc-20160816; b=zzQZuAKZk9zVrg33Zi9EMW6su72OpZI3GQHT87pnIFoMth5QZ4wcN9U8MobeSQKYXU AxDY4jBxtTPsCTRFFY/bPdf4otvZp6bbTYSWHmgxj9N0U0mmbgavH0NsIopIHdYC+itr tWWJR5GKaH9uUuPdfQpIk+vOLE1KARd3kwsjzxF7t2nI+gBG42M35tFFuMAZ94aDEOFX +ljpRl9BNa57QZr4X9ZG0hP9wCIlUaXu5nIYNzm/Ib+o8JhWSDwOGV/h9l9IqdXxTidF uQowy75Q6PKpr7SorcUzfl2IUaBvmVIJ19zFNwXEl6czlSLV1cfuhspOgGIVYFqjiEfS a8gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=e1i8FTAwyK8F0CK0FlOP478Jf+vsrNjPO8y9bm7rJ/8=; b=J9i6U7T71wfzM1i5u9m4bHovcUx8ZLmRVLSYFRCAv63La5X88rxhD1h5EUk9qJdiN4 tnfUvn4v2PyjlExV7EIf1uh/2h/6Zq2fc5Y8tD1FOpU8mJ11l6eGYJQCN6OoDQhyGDfS mWUG8JJqr7Rrnij5oVfiNdvkYNzBUHRlg0vWi2rea1XBnETBqQ8Gjb4kCU+E1tXFEHtZ 8ZjCXmTQ+tyPczEP2f+ImjQ88Zu6I7iNTKxSglK3g5qOIqfJDlCUZsEnnx2ViJ6x/hi7 t/MZdnBIQQn6hvWgCzbVCBSLRAkztRr63qXkkbeMIoyF5VMXKryls6+hG8gFBnytvcgj hDWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-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 q3si22700035ilu.88.2021.06.01.23.38.41 for ; Tue, 01 Jun 2021 23:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-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 S231261AbhFBGkU (ORCPT ); Wed, 2 Jun 2021 02:40:20 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2839 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231200AbhFBGkT (ORCPT ); Wed, 2 Jun 2021 02:40:19 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fvzkl3k5QzWq60; Wed, 2 Jun 2021 14:33:51 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 14:38:34 +0800 Received: from thunder-town.china.huawei.com (10.174.177.72) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 14:38:33 +0800 From: Zhen Lei To: "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] rtc: x1205: use DEVICE_ATTR_RO macro Date: Wed, 2 Jun 2021 14:38:28 +0800 Message-ID: <20210602063828.10958-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei --- drivers/rtc/rtc-x1205.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index d1d5a44d9122ad9..351e4725a7a5439 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c @@ -566,8 +566,8 @@ static const struct rtc_class_ops x1205_rtc_ops = { .set_alarm = x1205_rtc_set_alarm, }; -static ssize_t x1205_sysfs_show_atrim(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t atrim_show(struct device *dev, + struct device_attribute *attr, char *buf) { int err, atrim; @@ -577,10 +577,10 @@ static ssize_t x1205_sysfs_show_atrim(struct device *dev, return sprintf(buf, "%d.%02d pF\n", atrim / 1000, atrim % 1000); } -static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL); +static DEVICE_ATTR_RO(atrim); -static ssize_t x1205_sysfs_show_dtrim(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t dtrim_show(struct device *dev, + struct device_attribute *attr, char *buf) { int err, dtrim; @@ -590,7 +590,7 @@ static ssize_t x1205_sysfs_show_dtrim(struct device *dev, return sprintf(buf, "%d ppm\n", dtrim); } -static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL); +static DEVICE_ATTR_RO(dtrim); static int x1205_sysfs_register(struct device *dev) {