From 2877389f59dc455e4283ae23ad494b410c15b3a3 Mon Sep 17 00:00:00 2001 From: Zhen Lei Date: Wed, 2 Jun 2021 09:48:39 +0800 Subject: [PATCH] tty: vcc: use DEVICE_ATTR_*() macro Use DEVICE_ATTR_*() macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Acked-by: David S. Miller Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210602014839.10587-1-thunder.leizhen@huawei.com Signed-off-by: Greg Kroah-Hartman --- 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 e883b8f..ba79da2 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, -- 2.7.4