All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sparc64: vcc: use DEVICE_ATTR_*() macro
@ 2021-06-02  1:48 Zhen Lei
  2021-06-02 19:51 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhen Lei @ 2021-06-02  1:48 UTC (permalink / raw)
  To: David S . Miller, Greg Kroah-Hartman, Jiri Slaby, sparclinux,
	linux-kernel
  Cc: Zhen Lei

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 <thunder.leizhen@huawei.com>
---
 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,
-- 
2.26.0.106.g9fadedd



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] sparc64: vcc: use DEVICE_ATTR_*() macro
  2021-06-02  1:48 [PATCH 1/1] sparc64: vcc: use DEVICE_ATTR_*() macro Zhen Lei
@ 2021-06-02 19:51 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2021-06-02 19:51 UTC (permalink / raw)
  To: thunder.leizhen; +Cc: gregkh, jirislaby, sparclinux, linux-kernel

From: Zhen Lei <thunder.leizhen@huawei.com>
Date: Wed, 2 Jun 2021 09:48:39 +0800

> 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 <thunder.leizhen@huawei.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-02 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  1:48 [PATCH 1/1] sparc64: vcc: use DEVICE_ATTR_*() macro Zhen Lei
2021-06-02 19:51 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.