Skip to contentSkip to conversation

rapidio: use DEVICE_ATTR_RO macro

PATCH New Zhen Lei 1 participant 1 message Jun 2, 2021 Rapidio

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 rapidio: use DEVICE_ATTR_RO macro

Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read.

---
 drivers/rapidio/switches/idt_gen2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rapidio/switches/idt_gen2.c +2 -2
index 8a89bba17d39900..0fb91e6c691f456 100644
@@ -366,7 +366,7 @@ idtg2_em_handler(struct rio_dev *rdev, u8 portnum)
 }
 
 static ssize_t
-idtg2_show_errlog(struct device *dev, struct device_attribute *attr, char *buf)
+errlog_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct rio_dev *rdev = to_rio_dev(dev);
 	ssize_t len = 0;
@@ -384,7 +384,7 @@ idtg2_show_errlog(struct device *dev, struct device_attribute *attr, char *buf)
 	return len;
 }
 
-static DEVICE_ATTR(errlog, S_IRUGO, idtg2_show_errlog, NULL);
+static DEVICE_ATTR_RO(errlog);
 
 static int idtg2_sysfs(struct rio_dev *rdev, bool create)
 {
Signature · 1 line
2.26.0.106.g9fadedd