diff options
| -rw-r--r-- | driver-core-platform-convert-bus-code-to-use-dev_groups.patch | 43 | ||||
| -rw-r--r-- | driver-core-remove-struct-bus_type.dev_attrs.patch | 108 | ||||
| -rw-r--r-- | driver-core-remove-struct-bus_type.drv_attrs.patch | 101 | ||||
| -rw-r--r-- | f3.patch | 266 | ||||
| -rw-r--r-- | f4.patch | 285 | ||||
| -rw-r--r-- | hid-convert-bus-code-to-use-dev_groups.patch | 44 | ||||
| -rw-r--r-- | input-gameport-convert-bus-code-to-use-drv_groups.patch | 50 | ||||
| -rw-r--r-- | input-serio-convert-bus-code-to-use-drv_groups.patch | 72 | ||||
| -rw-r--r-- | mei-convert-bus-code-to-use-dev_groups.patch | 44 | ||||
| -rw-r--r-- | pci-convert-bus-code-to-use-drv_groups.patch | 54 | ||||
| -rw-r--r-- | pmu_bus-convert-bus-code-to-use-dev_groups.patch | 54 | ||||
| -rw-r--r-- | series | 16 | ||||
| -rw-r--r-- | usb-serial-convert-bus-code-to-use-drv_groups.patch | 59 | ||||
| -rw-r--r-- | workqueue-convert-bus-code-to-use-dev_groups.patch | 81 |
14 files changed, 722 insertions, 555 deletions
diff --git a/driver-core-platform-convert-bus-code-to-use-dev_groups.patch b/driver-core-platform-convert-bus-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..cb6473ca53ad3f --- /dev/null +++ b/driver-core-platform-convert-bus-code-to-use-dev_groups.patch @@ -0,0 +1,43 @@ +From foo@baz Fri Aug 23 14:13:45 PDT 2013 +Date: Fri, 23 Aug 2013 14:13:45 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: driver-core: platform: convert bus code to use dev_groups + +The dev_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the platform bus code to use +the correct field. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/base/platform.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -672,11 +672,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) + { +@@ -893,7 +895,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, diff --git a/driver-core-remove-struct-bus_type.dev_attrs.patch b/driver-core-remove-struct-bus_type.dev_attrs.patch new file mode 100644 index 00000000000000..81a0f123bdf549 --- /dev/null +++ b/driver-core-remove-struct-bus_type.dev_attrs.patch @@ -0,0 +1,108 @@ +From foo@baz Fri Aug 23 14:12:09 PDT 2013 +Date: Fri, 23 Aug 2013 14:12:09 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: driver-core: remove struct bus_type.dev_attrs + +Now that all in-kernel users of bus_type.dev_attrs have been converted +to use dev_groups instead, the dev_attrs field, and logic surrounding +it, can be removed. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/base/bus.c | 39 ++------------------------------------- + include/linux/device.h | 2 -- + 2 files changed, 2 insertions(+), 39 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/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; diff --git a/driver-core-remove-struct-bus_type.drv_attrs.patch b/driver-core-remove-struct-bus_type.drv_attrs.patch new file mode 100644 index 00000000000000..2efe0fb44276ed --- /dev/null +++ b/driver-core-remove-struct-bus_type.drv_attrs.patch @@ -0,0 +1,101 @@ +From foo@baz Fri Aug 23 13:27:50 PDT 2013 +Date: Fri, 23 Aug 2013 13:27:50 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: driver-core: remove struct bus_type.drv_attrs + +Now that all in-kernel users of bus_type.drv_attrs have been converted +to use drv_groups instead, the drv_attrs field, and logic surrounding +it, can be removed. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/base/bus.c | 40 ++-------------------------------------- + include/linux/device.h | 2 -- + 2 files changed, 2 insertions(+), 40 deletions(-) + +--- 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/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/f3.patch b/f3.patch deleted file mode 100644 index 8ab1eb3fdaac37..00000000000000 --- a/f3.patch +++ /dev/null @@ -1,266 +0,0 @@ ---- - 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/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); - -- --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 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 *usb_serial_drv_attrs[] = { -+ &driver_attr_new_id.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(usb_serial_drv); - - static void free_dynids(struct usb_serial_driver *drv) - { -@@ -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, - }; - - 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 deleted file mode 100644 index 1aef34afa81642..00000000000000 --- a/f4.patch +++ /dev/null @@ -1,285 +0,0 @@ ---- - 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 -@@ -672,11 +672,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) - { -@@ -893,7 +895,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 -@@ -6189,6 +6189,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, -@@ -6233,17 +6234,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 -@@ -3086,25 +3086,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; -@@ -3115,12 +3116,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) -@@ -3270,7 +3273,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/hid-convert-bus-code-to-use-dev_groups.patch b/hid-convert-bus-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..933bcbce5b4d69 --- /dev/null +++ b/hid-convert-bus-code-to-use-dev_groups.patch @@ -0,0 +1,44 @@ +From foo@baz Fri Aug 23 14:15:14 PDT 2013 +Date: Fri, 23 Aug 2013 14:15:14 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: HID: convert bus code to use dev_groups + +The dev_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the HID bus code to use +the correct field. + +Cc: Jiri Kosina <jkosina@suse.cz> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/hid/hid-core.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- 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, diff --git a/input-gameport-convert-bus-code-to-use-drv_groups.patch b/input-gameport-convert-bus-code-to-use-drv_groups.patch new file mode 100644 index 00000000000000..bc05c271cffe76 --- /dev/null +++ b/input-gameport-convert-bus-code-to-use-drv_groups.patch @@ -0,0 +1,50 @@ +From foo@baz Fri Aug 23 13:59:38 PDT 2013 +Date: Fri, 23 Aug 2013 13:59:38 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: Input: gameport: convert bus code to use drv_groups + +The drv_attrs field of struct bus_type is going away soon, drv_groups +should be used instead. This converts the gameport bus code to use the +correct field. + +Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/input/gameport/gameport.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- 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, diff --git a/input-serio-convert-bus-code-to-use-drv_groups.patch b/input-serio-convert-bus-code-to-use-drv_groups.patch new file mode 100644 index 00000000000000..bfb6b8520602a3 --- /dev/null +++ b/input-serio-convert-bus-code-to-use-drv_groups.patch @@ -0,0 +1,72 @@ +From foo@baz Fri Aug 23 13:59:46 PDT 2013 +Date: Fri, 23 Aug 2013 13:59:46 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: Input: serio: convert bus code to use drv_groups + +The drv_attrs field of struct bus_type is going away soon, drv_groups +should be used instead. This converts the serio bus code to use the +correct field. + +Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/input/serio/serio.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +--- 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); + +- +-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, diff --git a/mei-convert-bus-code-to-use-dev_groups.patch b/mei-convert-bus-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..64daf8e7e28d43 --- /dev/null +++ b/mei-convert-bus-code-to-use-dev_groups.patch @@ -0,0 +1,44 @@ +From foo@baz Fri Aug 23 14:15:28 PDT 2013 +Date: Fri, 23 Aug 2013 14:15:28 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: MEI: convert bus code to use dev_groups + +The dev_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the MEI bus code to use +the correct field. + +Cc: Tomas Winkler <tomas.winkler@intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/misc/mei/bus.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- 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, diff --git a/pci-convert-bus-code-to-use-drv_groups.patch b/pci-convert-bus-code-to-use-drv_groups.patch new file mode 100644 index 00000000000000..c42118ea82447d --- /dev/null +++ b/pci-convert-bus-code-to-use-drv_groups.patch @@ -0,0 +1,54 @@ +From foo@baz Fri Aug 23 13:59:52 PDT 2013 +Date: Fri, 23 Aug 2013 13:59:52 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: PCI: convert bus code to use drv_groups + +The drv_attrs field of struct bus_type is going away soon, drv_groups +should be used instead. This converts the PCI bus code to use the +correct field. + +Cc: Bjorn Helgaas <bhelgaas@google.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/pci/pci-driver.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- 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, + }; + diff --git a/pmu_bus-convert-bus-code-to-use-dev_groups.patch b/pmu_bus-convert-bus-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..bc7fd399445d97 --- /dev/null +++ b/pmu_bus-convert-bus-code-to-use-dev_groups.patch @@ -0,0 +1,54 @@ +From foo@baz Fri Aug 23 14:18:17 PDT 2013 +Date: Fri, 23 Aug 2013 14:18:17 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: pmu_bus: convert bus code to use dev_groups + +The dev_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the pmu bus code to use +the correct field. + +Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> +Cc: Paul Mackerras <paulus@samba.org> +Cc: Ingo Molnar <mingo@redhat.com> +Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + kernel/events/core.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -6189,6 +6189,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, +@@ -6233,17 +6234,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) @@ -101,10 +101,18 @@ rapidio-convert-bus-code-to-use-bus_groups.patch ppc-ibmebus-convert-bus-code-to-use-bus_groups.patch ppc-vio-convert-bus-code-to-use-bus_groups.patch scsi-fcoe-convert-bus-code-to-use-bus_groups.patch -driver-core-remove-struct-bus_type.bus_attrs.patch - +input-gameport-convert-bus-code-to-use-drv_groups.patch +input-serio-convert-bus-code-to-use-drv_groups.patch +pci-convert-bus-code-to-use-drv_groups.patch +usb-serial-convert-bus-code-to-use-drv_groups.patch +driver-core-platform-convert-bus-code-to-use-dev_groups.patch +hid-convert-bus-code-to-use-dev_groups.patch +mei-convert-bus-code-to-use-dev_groups.patch +pmu_bus-convert-bus-code-to-use-dev_groups.patch +workqueue-convert-bus-code-to-use-dev_groups.patch -f3.patch -f4.patch +driver-core-remove-struct-bus_type.bus_attrs.patch +driver-core-remove-struct-bus_type.drv_attrs.patch +driver-core-remove-struct-bus_type.dev_attrs.patch qlcnic_sysfs.patch diff --git a/usb-serial-convert-bus-code-to-use-drv_groups.patch b/usb-serial-convert-bus-code-to-use-drv_groups.patch new file mode 100644 index 00000000000000..98647aa6092686 --- /dev/null +++ b/usb-serial-convert-bus-code-to-use-drv_groups.patch @@ -0,0 +1,59 @@ +From foo@baz Fri Aug 23 13:58:06 PDT 2013 +Date: Fri, 23 Aug 2013 13:58:06 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: USB: serial: convert bus code to use drv_groups + +The drv_attrs field of struct bus_type is going away soon, drv_groups +should be used instead. This converts the USB serial bus code to use +the correct field. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/usb/serial/bus.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- 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 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 *usb_serial_drv_attrs[] = { ++ &driver_attr_new_id.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(usb_serial_drv); + + static void free_dynids(struct usb_serial_driver *drv) + { +@@ -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, + }; + + int usb_serial_bus_register(struct usb_serial_driver *driver) diff --git a/workqueue-convert-bus-code-to-use-dev_groups.patch b/workqueue-convert-bus-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..037554a3d6d4e5 --- /dev/null +++ b/workqueue-convert-bus-code-to-use-dev_groups.patch @@ -0,0 +1,81 @@ +From foo@baz Fri Aug 23 14:18:12 PDT 2013 +Date: Fri, 23 Aug 2013 14:18:12 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: workqueue: convert bus code to use dev_groups + +The dev_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the workqueue bus code to use +the correct field. + +Cc: Tejun Heo <tj@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + kernel/workqueue.c | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -3086,25 +3086,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; +@@ -3115,12 +3116,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) +@@ -3270,7 +3273,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) |
