hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/macintosh/macio_sysfs.c
....@@ -3,17 +3,6 @@
33 #include <linux/stat.h>
44 #include <asm/macio.h>
55
6
-
7
-#define macio_config_of_attr(field, format_string) \
8
-static ssize_t \
9
-field##_show (struct device *dev, struct device_attribute *attr, \
10
- char *buf) \
11
-{ \
12
- struct macio_dev *mdev = to_macio_device (dev); \
13
- return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \
14
-} \
15
-static DEVICE_ATTR_RO(field);
16
-
176 static ssize_t
187 compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
198 {
....@@ -58,8 +47,19 @@
5847 static DEVICE_ATTR_RO(modalias);
5948 static DEVICE_ATTR_RO(devspec);
6049
61
-macio_config_of_attr (name, "%s\n");
62
-macio_config_of_attr (type, "%s\n");
50
+static ssize_t name_show(struct device *dev,
51
+ struct device_attribute *attr, char *buf)
52
+{
53
+ return sprintf(buf, "%pOFn\n", dev->of_node);
54
+}
55
+static DEVICE_ATTR_RO(name);
56
+
57
+static ssize_t type_show(struct device *dev,
58
+ struct device_attribute *attr, char *buf)
59
+{
60
+ return sprintf(buf, "%s\n", of_node_get_device_type(dev->of_node));
61
+}
62
+static DEVICE_ATTR_RO(type);
6363
6464 static struct attribute *macio_dev_attrs[] = {
6565 &dev_attr_name.attr,