From patchwork Wed Jun 2 01:48:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 1486317 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=sparclinux-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FvsQC4Thqz9sSs for ; Wed, 2 Jun 2021 11:49:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbhFBBus (ORCPT ); Tue, 1 Jun 2021 21:50:48 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:6127 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbhFBBur (ORCPT ); Tue, 1 Jun 2021 21:50:47 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FvsLz6L99zYpmR; Wed, 2 Jun 2021 09:46:19 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggemv704-chm.china.huawei.com (10.3.19.47) 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 09:49:02 +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 09:49:01 +0800 From: Zhen Lei To: "David S . Miller" , Greg Kroah-Hartman , Jiri Slaby , sparclinux , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] sparc64: vcc: use DEVICE_ATTR_*() macro Date: Wed, 2 Jun 2021 09:48:39 +0800 Message-ID: <20210602014839.10587-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: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org Use DEVICE_ATTR_*() macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei Acked-by: David S. Miller --- drivers/tty/vcc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index 0355f4579ecf203..d06bcc3b4c07762 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -473,9 +473,9 @@ static struct vio_version vcc_versions[] = { static struct tty_port_operations vcc_port_ops = { 0 }; -static ssize_t vcc_sysfs_domain_show(struct device *dev, - struct device_attribute *attr, - char *buf) +static ssize_t domain_show(struct device *dev, + struct device_attribute *attr, + char *buf) { struct vcc_port *port; int rv; @@ -505,9 +505,9 @@ static int vcc_send_ctl(struct vcc_port *port, int ctl) return rv; } -static ssize_t vcc_sysfs_break_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t break_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { struct vcc_port *port; unsigned long flags; @@ -530,8 +530,8 @@ static ssize_t vcc_sysfs_break_store(struct device *dev, return rv; } -static DEVICE_ATTR(domain, 0400, vcc_sysfs_domain_show, NULL); -static DEVICE_ATTR(break, 0200, NULL, vcc_sysfs_break_store); +static DEVICE_ATTR_ADMIN_RO(domain); +static DEVICE_ATTR_WO(break); static struct attribute *vcc_sysfs_entries[] = { &dev_attr_domain.attr,