aboutsummaryrefslogtreecommitdiffstats
path: root/p29.patch
diff options
Diffstat (limited to 'p29.patch')
-rw-r--r--p29.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/p29.patch b/p29.patch
new file mode 100644
index 00000000000000..8081712d15e478
--- /dev/null
+++ b/p29.patch
@@ -0,0 +1,107 @@
+---
+ arch/powerpc/kernel/vio.c | 50 ++++++++++++++++++++++++++--------------------
+ 1 file changed, 29 insertions(+), 21 deletions(-)
+
+--- a/arch/powerpc/kernel/vio.c
++++ b/arch/powerpc/kernel/vio.c
+@@ -936,7 +936,7 @@ static void vio_cmo_bus_init(void)
+ /* sysfs device functions and data structures for CMO */
+
+ #define viodev_cmo_rd_attr(name) \
+-static ssize_t viodev_cmo_##name##_show(struct device *dev, \
++static ssize_t cmo_##name##_show(struct device *dev, \
+ struct device_attribute *attr, \
+ char *buf) \
+ { \
+@@ -950,7 +950,7 @@ static ssize_t viodev_cmo_allocs_failed_
+ return sprintf(buf, "%d\n", atomic_read(&viodev->cmo.allocs_failed));
+ }
+
+-static ssize_t viodev_cmo_allocs_failed_reset(struct device *dev,
++static ssize_t cmo_allocs_failed_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+ {
+ struct vio_dev *viodev = to_vio_dev(dev);
+@@ -958,7 +958,7 @@ static ssize_t viodev_cmo_allocs_failed_
+ return count;
+ }
+
+-static ssize_t viodev_cmo_desired_set(struct device *dev,
++static ssize_t cmo_desired_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+ {
+ struct vio_dev *viodev = to_vio_dev(dev);
+@@ -981,18 +981,25 @@ static ssize_t name_show(struct device *
+ static ssize_t devspec_show(struct device *, struct device_attribute *, char *);
+ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+ char *buf);
+-static struct device_attribute vio_cmo_dev_attrs[] = {
+- __ATTR_RO(name),
+- __ATTR_RO(devspec),
+- __ATTR_RO(modalias),
+- __ATTR(cmo_desired, S_IWUSR|S_IRUSR|S_IWGRP|S_IRGRP|S_IROTH,
+- viodev_cmo_desired_show, viodev_cmo_desired_set),
+- __ATTR(cmo_entitled, S_IRUGO, viodev_cmo_entitled_show, NULL),
+- __ATTR(cmo_allocated, S_IRUGO, viodev_cmo_allocated_show, NULL),
+- __ATTR(cmo_allocs_failed, S_IWUSR|S_IRUSR|S_IWGRP|S_IRGRP|S_IROTH,
+- viodev_cmo_allocs_failed_show, viodev_cmo_allocs_failed_reset),
+- __ATTR_NULL
++static DEVICE_ATTR_RO(name);
++static DEVICE_ATTR_RO(devspec);
++static DEVICE_ATTR_RO(modalias);
++static DEVICE_ATTR_RO(cmo_entitled);
++static DEVICE_ATTR_RO(cmo_allocated);
++static DEVICE_ATTR_RW(cmo_desired);
++static DEVICE_ATTR_RW(cmo_allocs_failed);
++
++static struct attribute *vio_cmo_dev_attrs[] = {
++ &dev_attr_name.attr,
++ &dev_attr_devspec.attr,
++ &dev_attr_modalias.attr,
++ &dev_attr_cmo_entitled.attr,
++ &dev_attr_cmo_allocated.attr,
++ &dev_attr_cmo_desired.attr,
++ &dev_attr_cmo_allocs_failed.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(vio_cmo_dev);
+
+ /* sysfs bus functions and data structures for CMO */
+
+@@ -1054,7 +1061,7 @@ ATTRIBUTE_GROUPS(vio_bus);
+
+ static void vio_cmo_sysfs_init(void)
+ {
+- vio_bus_type.dev_attrs = vio_cmo_dev_attrs;
++ vio_bus_type.dev_groups = vio_cmo_dev_groups;
+ vio_bus_type.bus_groups = vio_bus_groups;
+ }
+ #else /* CONFIG_PPC_SMLPAR */
+@@ -1549,12 +1556,13 @@ static ssize_t modalias_show(struct devi
+ return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
+ }
+
+-static struct device_attribute vio_dev_attrs[] = {
+- __ATTR_RO(name),
+- __ATTR_RO(devspec),
+- __ATTR_RO(modalias),
+- __ATTR_NULL
++static struct attribute *vio_dev_attrs[] = {
++ &dev_attr_name.attr,
++ &dev_attr_devspec.attr,
++ &dev_attr_modalias.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(vio_dev);
+
+ void vio_unregister_device(struct vio_dev *viodev)
+ {
+@@ -1590,7 +1598,7 @@ static int vio_hotplug(struct device *de
+
+ struct bus_type vio_bus_type = {
+ .name = "vio",
+- .dev_attrs = vio_dev_attrs,
++ .dev_groups = vio_dev_groups,
+ .uevent = vio_hotplug,
+ .match = vio_bus_match,
+ .probe = vio_bus_probe,