aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--f2.patch127
-rw-r--r--f3.patch276
-rw-r--r--f4.patch285
-rw-r--r--series1
4 files changed, 663 insertions, 26 deletions
diff --git a/f2.patch b/f2.patch
index e403b42486b5f1..1df7c8d67ff1a0 100644
--- a/f2.patch
+++ b/f2.patch
@@ -1,10 +1,53 @@
---
- drivers/block/rbd.c | 14 +++++++++-----
- drivers/pci/pci-driver.c | 2 +-
- drivers/pci/pci-sysfs.c | 16 +++++++++++++---
- drivers/pci/pci.h | 2 +-
- 4 files changed, 24 insertions(+), 10 deletions(-)
+ arch/powerpc/kernel/ibmebus.c | 12 +++++++-----
+ drivers/block/rbd.c | 14 +++++++++-----
+ drivers/pci/pci-driver.c | 2 +-
+ drivers/pci/pci-sysfs.c | 16 +++++++++++++---
+ drivers/pci/pci.h | 2 +-
+ drivers/rapidio/rio-driver.c | 2 +-
+ drivers/rapidio/rio-sysfs.c | 16 +++++++++++++---
+ drivers/rapidio/rio.h | 2 +-
+ drivers/scsi/fcoe/fcoe_sysfs.c | 14 +++++++++-----
+ 9 files changed, 55 insertions(+), 25 deletions(-)
+--- a/arch/powerpc/kernel/ibmebus.c
++++ b/arch/powerpc/kernel/ibmebus.c
+@@ -292,6 +292,7 @@ out:
+ return rc;
+ return count;
+ }
++static BUS_ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove);
+
+ static ssize_t ibmebus_store_remove(struct bus_type *bus,
+ const char *buf, size_t count)
+@@ -317,13 +318,14 @@ static ssize_t ibmebus_store_remove(stru
+ return -ENODEV;
+ }
+ }
+-
++static BUS_ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove);
+
+ static struct bus_attribute ibmebus_bus_attrs[] = {
+- __ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe),
+- __ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove),
+- __ATTR_NULL
++ &bus_attr_probe.attr,
++ &bus_attr_probe.remove,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(ibmbus_bus);
+
+ static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv)
+ {
+@@ -713,7 +715,7 @@ static struct dev_pm_ops ibmebus_bus_dev
+ struct bus_type ibmebus_bus_type = {
+ .name = "ibmebus",
+ .uevent = of_device_uevent_modalias,
+- .bus_attrs = ibmebus_bus_attrs,
++ .bus_groups = ibmbus_bus_groups,
+ .match = ibmebus_bus_bus_match,
+ .probe = ibmebus_bus_device_probe,
+ .remove = ibmebus_bus_device_remove,
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -397,15 +397,19 @@ static ssize_t rbd_remove(struct bus_typ
@@ -80,3 +123,77 @@
/**
+--- a/drivers/rapidio/rio-driver.c
++++ b/drivers/rapidio/rio-driver.c
+@@ -224,7 +224,7 @@ struct bus_type rio_bus_type = {
+ .name = "rapidio",
+ .match = rio_match_bus,
+ .dev_attrs = rio_dev_attrs,
+- .bus_attrs = rio_bus_attrs,
++ .bus_groups = rio_bus_groups,
+ .probe = rio_device_probe,
+ .remove = rio_device_remove,
+ .uevent = rio_uevent,
+--- a/drivers/rapidio/rio-sysfs.c
++++ b/drivers/rapidio/rio-sysfs.c
+@@ -316,8 +316,18 @@ exit:
+
+ return rc;
+ }
++static BUS_ATTR(scan, (S_IWUSR|S_IWGRP), NULL, bus_scan_store);
+
+-struct bus_attribute rio_bus_attrs[] = {
+- __ATTR(scan, (S_IWUSR|S_IWGRP), NULL, bus_scan_store),
+- __ATTR_NULL
++static struct bus_attribute rio_bus_attrs[] = {
++ &bus_attr_scan.attr,
++ NULL,
++};
++
++static const struct attribute_group rio_bus_group = {
++ .attrs = rio_bus_attrs,
++};
++
++const struct attribute_group *rio_bus_groups[] = {
++ &rio_bus_group,
++ NULL,
+ };
+--- a/drivers/rapidio/rio.h
++++ b/drivers/rapidio/rio.h
+@@ -49,7 +49,7 @@ extern int rio_mport_scan(int mport_id);
+
+ /* Structures internal to the RIO core code */
+ extern struct device_attribute rio_dev_attrs[];
+-extern struct bus_attribute rio_bus_attrs[];
++extern const struct attribute_group *rio_bus_groups[];
+
+ #define RIO_GET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16))
+ #define RIO_SET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16))
+--- a/drivers/scsi/fcoe/fcoe_sysfs.c
++++ b/drivers/scsi/fcoe/fcoe_sysfs.c
+@@ -553,16 +553,20 @@ struct device_type fcoe_fcf_device_type
+ .release = fcoe_fcf_device_release,
+ };
+
+-struct bus_attribute fcoe_bus_attr_group[] = {
+- __ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store),
+- __ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store),
+- __ATTR_NULL
++static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
++static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
++
++static struct attribute *fcoe_bus_attrs[] = {
++ &bus_attr_ctlr_create.attr,
++ &bus_attr_ctrl_destroy.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(fcoe_bus);
+
+ struct bus_type fcoe_bus_type = {
+ .name = "fcoe",
+ .match = &fcoe_bus_match,
+- .bus_attrs = fcoe_bus_attr_group,
++ .bus_groups = fcoe_bus_groups,
+ };
+
+ /**
diff --git a/f3.patch b/f3.patch
index 169d5d7933cccc..8ab1eb3fdaac37 100644
--- a/f3.patch
+++ b/f3.patch
@@ -1,32 +1,266 @@
---
- drivers/base/platform.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
+ drivers/base/bus.c | 40 +-------------------------------------
+ drivers/input/gameport/gameport.c | 12 ++++++-----
+ drivers/input/serio/serio.c | 21 ++++++++++---------
+ drivers/pci/pci-driver.c | 13 +++++++-----
+ drivers/usb/serial/bus.c | 14 +++++++------
+ include/linux/device.h | 2 -
+ 6 files changed, 36 insertions(+), 66 deletions(-)
---- a/drivers/base/platform.c
-+++ b/drivers/base/platform.c
-@@ -671,11 +671,13 @@ static ssize_t modalias_show(struct devi
+--- a/drivers/base/bus.c
++++ b/drivers/base/bus.c
+@@ -590,37 +590,6 @@ void bus_remove_device(struct device *de
+ bus_put(dev->bus);
+ }
+
+-static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv)
+-{
+- int error = 0;
+- int i;
+-
+- if (bus->drv_attrs) {
+- for (i = 0; attr_name(bus->drv_attrs[i]); i++) {
+- error = driver_create_file(drv, &bus->drv_attrs[i]);
+- if (error)
+- goto err;
+- }
+- }
+-done:
+- return error;
+-err:
+- while (--i >= 0)
+- driver_remove_file(drv, &bus->drv_attrs[i]);
+- goto done;
+-}
+-
+-static void driver_remove_attrs(struct bus_type *bus,
+- struct device_driver *drv)
+-{
+- int i;
+-
+- if (bus->drv_attrs) {
+- for (i = 0; attr_name(bus->drv_attrs[i]); i++)
+- driver_remove_file(drv, &bus->drv_attrs[i]);
+- }
+-}
+-
+ static int __must_check add_bind_files(struct device_driver *drv)
+ {
+ int ret;
+@@ -719,16 +688,12 @@ int bus_add_driver(struct device_driver
+ printk(KERN_ERR "%s: uevent attr (%s) failed\n",
+ __func__, drv->name);
+ }
+- error = driver_add_attrs(bus, drv);
++ error = driver_add_groups(drv, bus->drv_groups);
+ if (error) {
+ /* How the hell do we get out of this pickle? Give up */
+- printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n",
+- __func__, drv->name);
+- }
+- error = driver_add_groups(drv, bus->drv_groups);
+- if (error)
+ printk(KERN_ERR "%s: driver_create_groups(%s) failed\n",
+ __func__, drv->name);
++ }
+
+ if (!drv->suppress_bind_attrs) {
+ error = add_bind_files(drv);
+@@ -765,7 +730,6 @@ void bus_remove_driver(struct device_dri
+
+ if (!drv->suppress_bind_attrs)
+ remove_bind_files(drv);
+- driver_remove_attrs(drv->bus, drv);
+ driver_remove_groups(drv, drv->bus->drv_groups);
+ driver_remove_file(drv, &driver_attr_uevent);
+ klist_remove(&drv->p->knode_bus);
+--- a/drivers/input/gameport/gameport.c
++++ b/drivers/input/gameport/gameport.c
+@@ -639,16 +639,18 @@ EXPORT_SYMBOL(gameport_unregister_port);
+ * Gameport driver operations
+ */
+
+-static ssize_t gameport_driver_show_description(struct device_driver *drv, char *buf)
++static ssize_t description_show(struct device_driver *drv, char *buf)
+ {
+ struct gameport_driver *driver = to_gameport_driver(drv);
+ return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)");
+ }
++static DRIVER_ATTR_RO(description);
+
+-static struct driver_attribute gameport_driver_attrs[] = {
+- __ATTR(description, S_IRUGO, gameport_driver_show_description, NULL),
+- __ATTR_NULL
++static struct attribute *gameport_driver_attrs[] = {
++ &driver_attr_description.attr,
++ NULL
+ };
++ATTRIBUTE_GROUPS(gameport_driver);
+
+ static int gameport_driver_probe(struct device *dev)
+ {
+@@ -749,7 +751,7 @@ static int gameport_bus_match(struct dev
+ static struct bus_type gameport_bus = {
+ .name = "gameport",
+ .dev_attrs = gameport_device_attrs,
+- .drv_attrs = gameport_driver_attrs,
++ .drv_groups = gameport_driver_groups,
+ .match = gameport_bus_match,
+ .probe = gameport_driver_probe,
+ .remove = gameport_driver_remove,
+--- a/drivers/input/serio/serio.c
++++ b/drivers/input/serio/serio.c
+@@ -732,19 +732,20 @@ EXPORT_SYMBOL(serio_unregister_child_por
+ * Serio driver operations
+ */
+
+-static ssize_t serio_driver_show_description(struct device_driver *drv, char *buf)
++static ssize_t description_show(struct device_driver *drv, char *buf)
+ {
+ struct serio_driver *driver = to_serio_driver(drv);
+ return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)");
+ }
++static DRIVER_ATTR_RO(description);
+
+-static ssize_t serio_driver_show_bind_mode(struct device_driver *drv, char *buf)
++static ssize_t bind_mode_show(struct device_driver *drv, char *buf)
+ {
+ struct serio_driver *serio_drv = to_serio_driver(drv);
+ return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto");
+ }
+
+-static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char *buf, size_t count)
++static ssize_t bind_mode_store(struct device_driver *drv, const char *buf, size_t count)
+ {
+ struct serio_driver *serio_drv = to_serio_driver(drv);
+ int retval;
+@@ -760,14 +761,14 @@ static ssize_t serio_driver_set_bind_mod
+
+ return retval;
+ }
++static DRIVER_ATTR_RW(bind_mode);
- return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
+-
+-static struct driver_attribute serio_driver_attrs[] = {
+- __ATTR(description, S_IRUGO, serio_driver_show_description, NULL),
+- __ATTR(bind_mode, S_IWUSR | S_IRUGO,
+- serio_driver_show_bind_mode, serio_driver_set_bind_mode),
+- __ATTR_NULL
++static struct attribute *serio_driver_attrs[] = {
++ &driver_attr_description.attr,
++ &driver_attr_bind_mode.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(serio_driver);
+
+ static int serio_driver_probe(struct device *dev)
+ {
+@@ -996,7 +997,7 @@ EXPORT_SYMBOL(serio_interrupt);
+ static struct bus_type serio_bus = {
+ .name = "serio",
+ .dev_attrs = serio_device_attrs,
+- .drv_attrs = serio_driver_attrs,
++ .drv_groups = serio_driver_groups,
+ .match = serio_bus_match,
+ .uevent = serio_uevent,
+ .probe = serio_driver_probe,
+--- a/drivers/pci/pci-driver.c
++++ b/drivers/pci/pci-driver.c
+@@ -135,6 +135,7 @@ store_new_id(struct device_driver *drive
+ return retval;
+ return count;
+ }
++static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id);
+
+ /**
+ * store_remove_id - remove a PCI device ID from this driver
+@@ -180,12 +181,14 @@ store_remove_id(struct device_driver *dr
+ return retval;
+ return count;
+ }
++static DRIVER_ATTR(remove_id, S_IWUSR, NULL, store_remove_id);
+
+-static struct driver_attribute pci_drv_attrs[] = {
+- __ATTR(new_id, S_IWUSR, NULL, store_new_id),
+- __ATTR(remove_id, S_IWUSR, NULL, store_remove_id),
+- __ATTR_NULL,
++static struct attribute *pci_drv_attrs[] = {
++ &driver_attr_new_id.attr,
++ &driver_attr_remove_id.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(pci_drv);
+
+ /**
+ * pci_match_id - See if a pci device matches a given pci_id table
+@@ -1275,7 +1278,7 @@ struct bus_type pci_bus_type = {
+ .shutdown = pci_device_shutdown,
+ .dev_attrs = pci_dev_attrs,
+ .bus_groups = pci_bus_groups,
+- .drv_attrs = pci_drv_attrs,
++ .drv_groups = pci_drv_groups,
+ .pm = PCI_PM_OPS_PTR,
+ };
+
+--- a/drivers/usb/serial/bus.c
++++ b/drivers/usb/serial/bus.c
+@@ -122,7 +122,7 @@ static int usb_serial_device_remove(stru
+ return retval;
+ }
+
+-static ssize_t store_new_id(struct device_driver *driver,
++static ssize_t new_id_store(struct device_driver *driver,
+ const char *buf, size_t count)
+ {
+ struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
+@@ -135,17 +135,19 @@ static ssize_t store_new_id(struct devic
+ return retval;
}
-+static DEVICE_ATTR_RO(modalias);
--static struct device_attribute platform_dev_attrs[] = {
-- __ATTR_RO(modalias),
+-static ssize_t show_dynids(struct device_driver *driver, char *buf)
++static ssize_t new_id_show(struct device_driver *driver, char *buf)
+ {
+ struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
+
+ return usb_show_dynids(&usb_drv->dynids, buf);
+ }
++static DRIVER_ATTR_RW(new_id);
+
+-static struct driver_attribute drv_attrs[] = {
+- __ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id),
- __ATTR_NULL,
-+static struct attribute *platform_dev_attrs[] = {
-+ &dev_attr_modalias.attr,
++static struct attribute *usb_serial_drv_attrs[] = {
++ &driver_attr_new_id.attr,
+ NULL,
};
-+ATTRIBUTE_GROUPS(platform_dev);
++ATTRIBUTE_GROUPS(usb_serial_drv);
- static int platform_uevent(struct device *dev, struct kobj_uevent_env *env)
+ static void free_dynids(struct usb_serial_driver *drv)
{
-@@ -892,7 +894,7 @@ static const struct dev_pm_ops platform_
+@@ -164,7 +166,7 @@ struct bus_type usb_serial_bus_type = {
+ .match = usb_serial_device_match,
+ .probe = usb_serial_device_probe,
+ .remove = usb_serial_device_remove,
+- .drv_attrs = drv_attrs,
++ .drv_groups = usb_serial_drv_groups,
+ };
- struct bus_type platform_bus_type = {
- .name = "platform",
-- .dev_attrs = platform_dev_attrs,
-+ .dev_groups = platform_dev_groups,
- .match = platform_match,
- .uevent = platform_uevent,
- .pm = &platform_dev_pm_ops,
+ int usb_serial_bus_register(struct usb_serial_driver *driver)
+--- a/include/linux/device.h
++++ b/include/linux/device.h
+@@ -64,7 +64,6 @@ extern void bus_remove_file(struct bus_t
+ * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id).
+ * @dev_root: Default device to use as the parent.
+ * @dev_attrs: Default attributes of the devices on the bus.
+- * @drv_attrs: Default attributes of the device drivers on the bus.
+ * @bus_groups: Default attributes of the bus.
+ * @dev_groups: Default attributes of the devices on the bus.
+ * @drv_groups: Default attributes of the device drivers on the bus.
+@@ -106,7 +105,6 @@ struct bus_type {
+ const char *dev_name;
+ struct device *dev_root;
+ struct device_attribute *dev_attrs; /* use dev_groups instead */
+- struct driver_attribute *drv_attrs; /* use drv_groups instead */
+ const struct attribute_group **bus_groups;
+ const struct attribute_group **dev_groups;
+ const struct attribute_group **drv_groups;
diff --git a/f4.patch b/f4.patch
new file mode 100644
index 00000000000000..7a9a2787ac5bba
--- /dev/null
+++ b/f4.patch
@@ -0,0 +1,285 @@
+---
+ drivers/base/bus.c | 39 ++-------------------------------------
+ drivers/base/platform.c | 10 ++++++----
+ drivers/hid/hid-core.c | 10 ++++++----
+ drivers/misc/mei/bus.c | 10 ++++++----
+ include/linux/device.h | 2 --
+ kernel/events/core.c | 13 ++++++++-----
+ kernel/workqueue.c | 27 +++++++++++++++------------
+ 7 files changed, 43 insertions(+), 68 deletions(-)
+
+--- a/drivers/base/bus.c
++++ b/drivers/base/bus.c
+@@ -452,35 +452,6 @@ int bus_for_each_drv(struct bus_type *bu
+ }
+ EXPORT_SYMBOL_GPL(bus_for_each_drv);
+
+-static int device_add_attrs(struct bus_type *bus, struct device *dev)
+-{
+- int error = 0;
+- int i;
+-
+- if (!bus->dev_attrs)
+- return 0;
+-
+- for (i = 0; attr_name(bus->dev_attrs[i]); i++) {
+- error = device_create_file(dev, &bus->dev_attrs[i]);
+- if (error) {
+- while (--i >= 0)
+- device_remove_file(dev, &bus->dev_attrs[i]);
+- break;
+- }
+- }
+- return error;
+-}
+-
+-static void device_remove_attrs(struct bus_type *bus, struct device *dev)
+-{
+- int i;
+-
+- if (bus->dev_attrs) {
+- for (i = 0; attr_name(bus->dev_attrs[i]); i++)
+- device_remove_file(dev, &bus->dev_attrs[i]);
+- }
+-}
+-
+ /**
+ * bus_add_device - add device to bus
+ * @dev: device being added
+@@ -496,16 +467,13 @@ int bus_add_device(struct device *dev)
+
+ if (bus) {
+ pr_debug("bus: '%s': add device %s\n", bus->name, dev_name(dev));
+- error = device_add_attrs(bus, dev);
+- if (error)
+- goto out_put;
+ error = device_add_groups(dev, bus->dev_groups);
+ if (error)
+- goto out_groups;
++ goto out_put;
+ error = sysfs_create_link(&bus->p->devices_kset->kobj,
+ &dev->kobj, dev_name(dev));
+ if (error)
+- goto out_id;
++ goto out_groups;
+ error = sysfs_create_link(&dev->kobj,
+ &dev->bus->p->subsys.kobj, "subsystem");
+ if (error)
+@@ -518,8 +486,6 @@ out_subsys:
+ sysfs_remove_link(&bus->p->devices_kset->kobj, dev_name(dev));
+ out_groups:
+ device_remove_groups(dev, bus->dev_groups);
+-out_id:
+- device_remove_attrs(bus, dev);
+ out_put:
+ bus_put(dev->bus);
+ return error;
+@@ -579,7 +545,6 @@ void bus_remove_device(struct device *de
+ sysfs_remove_link(&dev->kobj, "subsystem");
+ sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
+ dev_name(dev));
+- device_remove_attrs(dev->bus, dev);
+ device_remove_groups(dev, dev->bus->dev_groups);
+ if (klist_node_attached(&dev->p->knode_bus))
+ klist_del(&dev->p->knode_bus);
+--- a/drivers/base/platform.c
++++ b/drivers/base/platform.c
+@@ -671,11 +671,13 @@ static ssize_t modalias_show(struct devi
+
+ return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
+ }
++static DEVICE_ATTR_RO(modalias);
+
+-static struct device_attribute platform_dev_attrs[] = {
+- __ATTR_RO(modalias),
+- __ATTR_NULL,
++static struct attribute *platform_dev_attrs[] = {
++ &dev_attr_modalias.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(platform_dev);
+
+ static int platform_uevent(struct device *dev, struct kobj_uevent_env *env)
+ {
+@@ -892,7 +894,7 @@ static const struct dev_pm_ops platform_
+
+ struct bus_type platform_bus_type = {
+ .name = "platform",
+- .dev_attrs = platform_dev_attrs,
++ .dev_groups = platform_dev_groups,
+ .match = platform_match,
+ .uevent = platform_uevent,
+ .pm = &platform_dev_pm_ops,
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1917,11 +1917,13 @@ static ssize_t modalias_show(struct devi
+
+ return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
+ }
++static DEVICE_ATTR_RO(modalias);
+
+-static struct device_attribute hid_dev_attrs[] = {
+- __ATTR_RO(modalias),
+- __ATTR_NULL,
++static struct attribute *hid_dev_attrs[] = {
++ &dev_attr_modalias.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(hid_dev);
+
+ static int hid_uevent(struct device *dev, struct kobj_uevent_env *env)
+ {
+@@ -1949,7 +1951,7 @@ static int hid_uevent(struct device *dev
+
+ static struct bus_type hid_bus_type = {
+ .name = "hid",
+- .dev_attrs = hid_dev_attrs,
++ .dev_groups = hid_dev_groups,
+ .match = hid_bus_match,
+ .probe = hid_device_probe,
+ .remove = hid_device_remove,
+--- a/drivers/misc/mei/bus.c
++++ b/drivers/misc/mei/bus.c
+@@ -108,11 +108,13 @@ static ssize_t modalias_show(struct devi
+
+ return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
+ }
++static DEVICE_ATTR_RO(modalias);
+
+-static struct device_attribute mei_cl_dev_attrs[] = {
+- __ATTR_RO(modalias),
+- __ATTR_NULL,
++static struct attribute *mei_cl_dev_attrs[] = {
++ &dev_attr_modalias.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(mei_cl_dev);
+
+ static int mei_cl_uevent(struct device *dev, struct kobj_uevent_env *env)
+ {
+@@ -124,7 +126,7 @@ static int mei_cl_uevent(struct device *
+
+ static struct bus_type mei_cl_bus_type = {
+ .name = "mei",
+- .dev_attrs = mei_cl_dev_attrs,
++ .dev_groups = mei_cl_dev_groups,
+ .match = mei_cl_device_match,
+ .probe = mei_cl_device_probe,
+ .remove = mei_cl_device_remove,
+--- a/include/linux/device.h
++++ b/include/linux/device.h
+@@ -63,7 +63,6 @@ extern void bus_remove_file(struct bus_t
+ * @name: The name of the bus.
+ * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id).
+ * @dev_root: Default device to use as the parent.
+- * @dev_attrs: Default attributes of the devices on the bus.
+ * @bus_groups: Default attributes of the bus.
+ * @dev_groups: Default attributes of the devices on the bus.
+ * @drv_groups: Default attributes of the device drivers on the bus.
+@@ -104,7 +103,6 @@ struct bus_type {
+ const char *name;
+ const char *dev_name;
+ struct device *dev_root;
+- struct device_attribute *dev_attrs; /* use dev_groups instead */
+ const struct attribute_group **bus_groups;
+ const struct attribute_group **dev_groups;
+ const struct attribute_group **drv_groups;
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -6167,6 +6167,7 @@ type_show(struct device *dev, struct dev
+
+ return snprintf(page, PAGE_SIZE-1, "%d\n", pmu->type);
+ }
++static DEVICE_ATTR_RO(type);
+
+ static ssize_t
+ perf_event_mux_interval_ms_show(struct device *dev,
+@@ -6211,17 +6212,19 @@ perf_event_mux_interval_ms_store(struct
+
+ return count;
+ }
++static DEVICE_ATTR_RW(perf_event_mux_interval_ms);
+
+-static struct device_attribute pmu_dev_attrs[] = {
+- __ATTR_RO(type),
+- __ATTR_RW(perf_event_mux_interval_ms),
+- __ATTR_NULL,
++static struct attribute *pmu_dev_attrs[] = {
++ &dev_attr_type.attr,
++ &dev_attr_perf_event_mux_interval_ms.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(pmu_dev);
+
+ static int pmu_bus_running;
+ static struct bus_type pmu_bus = {
+ .name = "event_source",
+- .dev_attrs = pmu_dev_attrs,
++ .dev_groups = pmu_dev_groups,
+ };
+
+ static void pmu_dev_release(struct device *dev)
+--- a/kernel/workqueue.c
++++ b/kernel/workqueue.c
+@@ -3081,25 +3081,26 @@ static struct workqueue_struct *dev_to_w
+ return wq_dev->wq;
+ }
+
+-static ssize_t wq_per_cpu_show(struct device *dev,
+- struct device_attribute *attr, char *buf)
++static ssize_t per_cpu_show(struct device *dev, struct device_attribute *attr,
++ char *buf)
+ {
+ struct workqueue_struct *wq = dev_to_wq(dev);
+
+ return scnprintf(buf, PAGE_SIZE, "%d\n", (bool)!(wq->flags & WQ_UNBOUND));
+ }
++static DEVICE_ATTR_RO(per_cpu);
+
+-static ssize_t wq_max_active_show(struct device *dev,
+- struct device_attribute *attr, char *buf)
++static ssize_t max_active_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct workqueue_struct *wq = dev_to_wq(dev);
+
+ return scnprintf(buf, PAGE_SIZE, "%d\n", wq->saved_max_active);
+ }
+
+-static ssize_t wq_max_active_store(struct device *dev,
+- struct device_attribute *attr,
+- const char *buf, size_t count)
++static ssize_t max_active_store(struct device *dev,
++ struct device_attribute *attr, const char *buf,
++ size_t count)
+ {
+ struct workqueue_struct *wq = dev_to_wq(dev);
+ int val;
+@@ -3110,12 +3111,14 @@ static ssize_t wq_max_active_store(struc
+ workqueue_set_max_active(wq, val);
+ return count;
+ }
++static DEVICE_ATTR_RW(max_active);
+
+-static struct device_attribute wq_sysfs_attrs[] = {
+- __ATTR(per_cpu, 0444, wq_per_cpu_show, NULL),
+- __ATTR(max_active, 0644, wq_max_active_show, wq_max_active_store),
+- __ATTR_NULL,
++static struct attribute *wq_sysfs_attrs[] = {
++ &dev_attr_per_cpu.attr,
++ &dev_attr_max_active.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(wq_sysfs);
+
+ static ssize_t wq_pool_ids_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+@@ -3265,7 +3268,7 @@ static struct device_attribute wq_sysfs_
+
+ static struct bus_type wq_subsys = {
+ .name = "workqueue",
+- .dev_attrs = wq_sysfs_attrs,
++ .dev_groups = wq_sysfs_groups,
+ };
+
+ static int __init wq_sysfs_init(void)
diff --git a/series b/series
index 9e0e67d6b0b674..cad4d244de751d 100644
--- a/series
+++ b/series
@@ -94,3 +94,4 @@ driver-core-bus_type-add-bus_groups.patch
f1.patch
f2.patch
f3.patch
+f4.patch