diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 23:10:14 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 23:10:14 -0700 |
| commit | 9e06a307a040bb17573afb2f48b6a7d26920394f (patch) | |
| tree | 222b8cbd15a432f906f01dcd21de484984a01bc4 | |
| parent | 439aaed86577bc756086c2193f8fa23ae48d6722 (diff) | |
| download | patches-9e06a307a040bb17573afb2f48b6a7d26920394f.tar.gz | |
new dev_attr bus removal patches added
| -rw-r--r-- | p06.patch | 59 | ||||
| -rw-r--r-- | p07.patch | 136 | ||||
| -rw-r--r-- | p08.patch | 106 | ||||
| -rw-r--r-- | p09.patch | 52 | ||||
| -rw-r--r-- | p10.patch | 88 | ||||
| -rw-r--r-- | p11.patch | 32 | ||||
| -rw-r--r-- | p12.patch | 52 | ||||
| -rw-r--r-- | p13.patch | 32 | ||||
| -rw-r--r-- | p14.patch | 74 | ||||
| -rw-r--r-- | p15.patch | 28 | ||||
| -rw-r--r-- | p16.patch | 40 | ||||
| -rw-r--r-- | p17.patch | 97 | ||||
| -rw-r--r-- | p18.patch | 92 | ||||
| -rw-r--r-- | p19.patch | 52 | ||||
| -rw-r--r-- | p20.patch | 50 | ||||
| -rw-r--r-- | p21.patch | 38 | ||||
| -rw-r--r-- | p22.patch | 49 | ||||
| -rw-r--r-- | p23.patch | 50 | ||||
| -rw-r--r-- | p24.patch | 68 | ||||
| -rw-r--r-- | p25.patch | 72 | ||||
| -rw-r--r-- | p26.patch | 86 | ||||
| -rw-r--r-- | p27.patch | 32 | ||||
| -rw-r--r-- | p28.patch | 52 | ||||
| -rw-r--r-- | series | 24 |
24 files changed, 1461 insertions, 0 deletions
diff --git a/p06.patch b/p06.patch new file mode 100644 index 00000000000000..983028cd548547 --- /dev/null +++ b/p06.patch @@ -0,0 +1,59 @@ +--- + drivers/bcma/main.c | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +--- a/drivers/bcma/main.c ++++ b/drivers/bcma/main.c +@@ -30,28 +30,37 @@ static ssize_t manuf_show(struct device + struct bcma_device *core = container_of(dev, struct bcma_device, dev); + return sprintf(buf, "0x%03X\n", core->id.manuf); + } ++static DEVICE_ATTR_RO(manuf); ++ + static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct bcma_device *core = container_of(dev, struct bcma_device, dev); + return sprintf(buf, "0x%03X\n", core->id.id); + } ++static DEVICE_ATTR_RO(id); ++ + static ssize_t rev_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct bcma_device *core = container_of(dev, struct bcma_device, dev); + return sprintf(buf, "0x%02X\n", core->id.rev); + } ++static DEVICE_ATTR_RO(rev); ++ + static ssize_t class_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct bcma_device *core = container_of(dev, struct bcma_device, dev); + return sprintf(buf, "0x%X\n", core->id.class); + } +-static struct device_attribute bcma_device_attrs[] = { +- __ATTR_RO(manuf), +- __ATTR_RO(id), +- __ATTR_RO(rev), +- __ATTR_RO(class), +- __ATTR_NULL, ++static DEVICE_ATTR_RO(class); ++ ++static struct attribute *bcma_device_attrs[] = { ++ &dev_attr_manuf.attr, ++ &dev_attr_id.attr, ++ &dev_attr_rev.attr, ++ &dev_attr_class.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(bcma_device); + + static struct bus_type bcma_bus_type = { + .name = "bcma", +@@ -59,7 +68,7 @@ static struct bus_type bcma_bus_type = { + .probe = bcma_device_probe, + .remove = bcma_device_remove, + .uevent = bcma_device_uevent, +- .dev_attrs = bcma_device_attrs, ++ .dev_groups = bcma_device_groups, + }; + + static u16 bcma_cc_core_id(struct bcma_bus *bus) diff --git a/p07.patch b/p07.patch new file mode 100644 index 00000000000000..a04b2c093314a7 --- /dev/null +++ b/p07.patch @@ -0,0 +1,136 @@ +--- + drivers/pcmcia/ds.c | 63 +++++++++++++++++++++++++++++++--------------------- + 1 file changed, 38 insertions(+), 25 deletions(-) + +--- a/drivers/pcmcia/ds.c ++++ b/drivers/pcmcia/ds.c +@@ -992,16 +992,17 @@ static ssize_t field##_show (struct devi + { \ + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ + return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \ +-} ++} \ ++static DEVICE_ATTR_RO(field); + + #define pcmcia_device_stringattr(name, field) \ + static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ + { \ + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ + return p_dev->field ? sprintf(buf, "%s\n", p_dev->field) : -ENODEV; \ +-} ++} \ ++static DEVICE_ATTR_RO(name); + +-pcmcia_device_attr(func, socket, "0x%02x\n"); + pcmcia_device_attr(func_id, has_func_id, "0x%02x\n"); + pcmcia_device_attr(manf_id, has_manf_id, "0x%04x\n"); + pcmcia_device_attr(card_id, has_card_id, "0x%04x\n"); +@@ -1010,8 +1011,16 @@ pcmcia_device_stringattr(prod_id2, prod_ + pcmcia_device_stringattr(prod_id3, prod_id[2]); + pcmcia_device_stringattr(prod_id4, prod_id[3]); + +-static ssize_t pcmcia_show_resources(struct device *dev, +- struct device_attribute *attr, char *buf) ++static ssize_t function_show(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); ++ return p_dev->socket ? sprintf(buf, "0x%02x\n", p_dev->func) : -ENODEV; ++} ++static DEVICE_ATTR_RO(function); ++ ++static ssize_t resources_show(struct device *dev, ++ struct device_attribute *attr, char *buf) + { + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); + char *str = buf; +@@ -1022,8 +1031,9 @@ static ssize_t pcmcia_show_resources(str + + return str - buf; + } ++static DEVICE_ATTR_RO(resources); + +-static ssize_t pcmcia_show_pm_state(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t pm_state_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); + +@@ -1033,8 +1043,8 @@ static ssize_t pcmcia_show_pm_state(stru + return sprintf(buf, "on\n"); + } + +-static ssize_t pcmcia_store_pm_state(struct device *dev, struct device_attribute *attr, +- const char *buf, size_t count) ++static ssize_t pm_state_store(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) + { + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); + int ret = 0; +@@ -1049,7 +1059,7 @@ static ssize_t pcmcia_store_pm_state(str + + return ret ? ret : count; + } +- ++static DEVICE_ATTR_RW(pm_state); + + static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) + { +@@ -1072,8 +1082,9 @@ static ssize_t modalias_show(struct devi + p_dev->func, p_dev->device_no, + hash[0], hash[1], hash[2], hash[3]); + } ++static DEVICE_ATTR_RO(modalias); + +-static ssize_t pcmcia_store_allow_func_id_match(struct device *dev, ++static ssize_t allow_func_id_match_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) + { + struct pcmcia_device *p_dev = to_pcmcia_dev(dev); +@@ -1088,22 +1099,24 @@ static ssize_t pcmcia_store_allow_func_i + + return count; + } ++static DEVICE_ATTR_WO(allow_func_id_match); + +-static struct device_attribute pcmcia_dev_attrs[] = { +- __ATTR(function, 0444, func_show, NULL), +- __ATTR(pm_state, 0644, pcmcia_show_pm_state, pcmcia_store_pm_state), +- __ATTR(resources, 0444, pcmcia_show_resources, NULL), +- __ATTR_RO(func_id), +- __ATTR_RO(manf_id), +- __ATTR_RO(card_id), +- __ATTR_RO(prod_id1), +- __ATTR_RO(prod_id2), +- __ATTR_RO(prod_id3), +- __ATTR_RO(prod_id4), +- __ATTR_RO(modalias), +- __ATTR(allow_func_id_match, 0200, NULL, pcmcia_store_allow_func_id_match), +- __ATTR_NULL, ++static struct attribute *pcmcia_dev_attrs[] = { ++ &dev_attr_resources.attr, ++ &dev_attr_pm_state.attr, ++ &dev_attr_function.attr, ++ &dev_attr_func_id.attr, ++ &dev_attr_manf_id.attr, ++ &dev_attr_card_id.attr, ++ &dev_attr_prod_id1.attr, ++ &dev_attr_prod_id2.attr, ++ &dev_attr_prod_id3.attr, ++ &dev_attr_prod_id4.attr, ++ &dev_attr_modalias.attr, ++ &dev_attr_allow_func_id_match.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(pcmcia_dev); + + /* PM support, also needed for reset */ + +@@ -1389,7 +1402,7 @@ struct bus_type pcmcia_bus_type = { + .name = "pcmcia", + .uevent = pcmcia_bus_uevent, + .match = pcmcia_bus_match, +- .dev_attrs = pcmcia_dev_attrs, ++ .dev_groups = pcmcia_dev_groups, + .probe = pcmcia_device_probe, + .remove = pcmcia_device_remove, + .suspend = pcmcia_dev_suspend, diff --git a/p08.patch b/p08.patch new file mode 100644 index 00000000000000..a59cf69031439d --- /dev/null +++ b/p08.patch @@ -0,0 +1,106 @@ +--- + drivers/rapidio/rio-driver.c | 2 +- + drivers/rapidio/rio-sysfs.c | 38 ++++++++++++++++++++++++-------------- + drivers/rapidio/rio.h | 2 +- + 3 files changed, 26 insertions(+), 16 deletions(-) + +--- a/drivers/rapidio/rio-driver.c ++++ b/drivers/rapidio/rio-driver.c +@@ -223,7 +223,7 @@ struct device rio_bus = { + struct bus_type rio_bus_type = { + .name = "rapidio", + .match = rio_match_bus, +- .dev_attrs = rio_dev_attrs, ++ .dev_groups = rio_dev_groups, + .bus_groups = rio_bus_groups, + .probe = rio_device_probe, + .remove = rio_device_remove, +--- a/drivers/rapidio/rio-sysfs.c ++++ b/drivers/rapidio/rio-sysfs.c +@@ -27,6 +27,7 @@ field##_show(struct device *dev, struct + \ + return sprintf(buf, format_string, rdev->field); \ + } \ ++static DEVICE_ATTR_RO(field); + + rio_config_attr(did, "0x%04x\n"); + rio_config_attr(vid, "0x%04x\n"); +@@ -54,6 +55,7 @@ static ssize_t routes_show(struct device + + return (str - buf); + } ++static DEVICE_ATTR_RO(routes); + + static ssize_t lprev_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -63,6 +65,7 @@ static ssize_t lprev_show(struct device + return sprintf(buf, "%s\n", + (rdev->prev) ? rio_name(rdev->prev) : "root"); + } ++static DEVICE_ATTR_RO(lprev); + + static ssize_t lnext_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -83,6 +86,7 @@ static ssize_t lnext_show(struct device + + return str - buf; + } ++static DEVICE_ATTR_RO(lnext); + + static ssize_t modalias_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -92,23 +96,29 @@ static ssize_t modalias_show(struct devi + return sprintf(buf, "rapidio:v%04Xd%04Xav%04Xad%04X\n", + rdev->vid, rdev->did, rdev->asm_vid, rdev->asm_did); + } ++static DEVICE_ATTR_RO(modalias); + +-struct device_attribute rio_dev_attrs[] = { +- __ATTR_RO(did), +- __ATTR_RO(vid), +- __ATTR_RO(device_rev), +- __ATTR_RO(asm_did), +- __ATTR_RO(asm_vid), +- __ATTR_RO(asm_rev), +- __ATTR_RO(lprev), +- __ATTR_RO(destid), +- __ATTR_RO(modalias), +- __ATTR_NULL, ++static struct attribute *rio_dev_attrs[] = { ++ &dev_attr_did.attr, ++ &dev_attr_vid.attr, ++ &dev_attr_device_rev.attr, ++ &dev_attr_asm_did.attr, ++ &dev_attr_asm_vid.attr, ++ &dev_attr_asm_rev.attr, ++ &dev_attr_lprev.attr, ++ &dev_attr_destid.attr, ++ &dev_attr_modalias.attr, ++ NULL, + }; + +-static DEVICE_ATTR(routes, S_IRUGO, routes_show, NULL); +-static DEVICE_ATTR(lnext, S_IRUGO, lnext_show, NULL); +-static DEVICE_ATTR(hopcount, S_IRUGO, hopcount_show, NULL); ++static const struct attribute_group rio_dev_group = { ++ .attrs = rio_dev_attrs, ++}; ++ ++const struct attribute_group *rio_dev_groups[] = { ++ &rio_dev_group, ++ NULL, ++}; + + static ssize_t + rio_read_config(struct file *filp, struct kobject *kobj, +--- a/drivers/rapidio/rio.h ++++ b/drivers/rapidio/rio.h +@@ -48,7 +48,7 @@ extern struct rio_mport *rio_find_mport( + extern int rio_mport_scan(int mport_id); + + /* Structures internal to the RIO core code */ +-extern struct device_attribute rio_dev_attrs[]; ++extern const struct attribute_group *rio_dev_groups[]; + extern const struct attribute_group *rio_bus_groups[]; + + #define RIO_GET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16)) diff --git a/p09.patch b/p09.patch new file mode 100644 index 00000000000000..96de9b4ed3484a --- /dev/null +++ b/p09.patch @@ -0,0 +1,52 @@ +--- + drivers/ssb/main.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +--- a/drivers/ssb/main.c ++++ b/drivers/ssb/main.c +@@ -374,7 +374,8 @@ static ssize_t \ + attrib##_show(struct device *dev, struct device_attribute *attr, char *buf) \ + { \ + return sprintf(buf, format_string, dev_to_ssb_dev(dev)->field); \ +-} ++} \ ++static DEVICE_ATTR_RO(attrib); + + ssb_config_attr(core_num, core_index, "%u\n") + ssb_config_attr(coreid, id.coreid, "0x%04x\n") +@@ -387,16 +388,18 @@ name_show(struct device *dev, struct dev + return sprintf(buf, "%s\n", + ssb_core_name(dev_to_ssb_dev(dev)->id.coreid)); + } ++static DEVICE_ATTR_RO(name); + +-static struct device_attribute ssb_device_attrs[] = { +- __ATTR_RO(name), +- __ATTR_RO(core_num), +- __ATTR_RO(coreid), +- __ATTR_RO(vendor), +- __ATTR_RO(revision), +- __ATTR_RO(irq), +- __ATTR_NULL, ++static struct attribute *ssb_device_attrs[] = { ++ &dev_attr_name.attr, ++ &dev_attr_core_num.attr, ++ &dev_attr_coreid.attr, ++ &dev_attr_vendor.attr, ++ &dev_attr_revision.attr, ++ &dev_attr_irq.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(ssb_device); + + static struct bus_type ssb_bustype = { + .name = "ssb", +@@ -407,7 +410,7 @@ static struct bus_type ssb_bustype = { + .suspend = ssb_device_suspend, + .resume = ssb_device_resume, + .uevent = ssb_device_uevent, +- .dev_attrs = ssb_device_attrs, ++ .dev_groups = ssb_device_groups, + }; + + static void ssb_buses_lock(void) diff --git a/p10.patch b/p10.patch new file mode 100644 index 00000000000000..9925d665ac1234 --- /dev/null +++ b/p10.patch @@ -0,0 +1,88 @@ +--- + drivers/xen/xenbus/xenbus_probe.c | 24 ++++++++++++++++++------ + drivers/xen/xenbus/xenbus_probe.h | 2 +- + drivers/xen/xenbus/xenbus_probe_backend.c | 2 +- + drivers/xen/xenbus/xenbus_probe_frontend.c | 2 +- + 4 files changed, 21 insertions(+), 9 deletions(-) + +--- a/drivers/xen/xenbus/xenbus_probe.c ++++ b/drivers/xen/xenbus/xenbus_probe.c +@@ -384,12 +384,14 @@ static ssize_t nodename_show(struct devi + { + return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename); + } ++static DEVICE_ATTR_RO(nodename); + + static ssize_t devtype_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype); + } ++static DEVICE_ATTR_RO(devtype); + + static ssize_t modalias_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -397,14 +399,24 @@ static ssize_t modalias_show(struct devi + return sprintf(buf, "%s:%s\n", dev->bus->name, + to_xenbus_device(dev)->devicetype); + } ++static DEVICE_ATTR_RO(modalias); + +-struct device_attribute xenbus_dev_attrs[] = { +- __ATTR_RO(nodename), +- __ATTR_RO(devtype), +- __ATTR_RO(modalias), +- __ATTR_NULL ++static struct attribute *xenbus_dev_attrs[] = { ++ &dev_attr_nodename.attr, ++ &dev_attr_devtype.attr, ++ &dev_attr_modalias.attr, ++ NULL, + }; +-EXPORT_SYMBOL_GPL(xenbus_dev_attrs); ++ ++static const struct attribute_group xenbus_dev_group = { ++ .attrs = xenbus_dev_attrs, ++}; ++ ++const struct attribute_group *xenbus_dev_groups[] = { ++ &xenbus_dev_group, ++ NULL, ++}; ++EXPORT_SYMBOL_GPL(xenbus_dev_groups); + + int xenbus_probe_node(struct xen_bus_type *bus, + const char *type, +--- a/drivers/xen/xenbus/xenbus_probe.h ++++ b/drivers/xen/xenbus/xenbus_probe.h +@@ -54,7 +54,7 @@ enum xenstore_init { + XS_LOCAL, + }; + +-extern struct device_attribute xenbus_dev_attrs[]; ++extern const struct attribute_group *xenbus_dev_groups[]; + + extern int xenbus_match(struct device *_dev, struct device_driver *_drv); + extern int xenbus_dev_probe(struct device *_dev); +--- a/drivers/xen/xenbus/xenbus_probe_backend.c ++++ b/drivers/xen/xenbus/xenbus_probe_backend.c +@@ -200,7 +200,7 @@ static struct xen_bus_type xenbus_backen + .probe = xenbus_dev_probe, + .remove = xenbus_dev_remove, + .shutdown = xenbus_dev_shutdown, +- .dev_attrs = xenbus_dev_attrs, ++ .dev_groups = xenbus_dev_groups, + }, + }; + +--- a/drivers/xen/xenbus/xenbus_probe_frontend.c ++++ b/drivers/xen/xenbus/xenbus_probe_frontend.c +@@ -154,7 +154,7 @@ static struct xen_bus_type xenbus_fronte + .probe = xenbus_frontend_dev_probe, + .remove = xenbus_dev_remove, + .shutdown = xenbus_dev_shutdown, +- .dev_attrs = xenbus_dev_attrs, ++ .dev_groups = xenbus_dev_groups, + + .pm = &xenbus_pm_ops, + }, diff --git a/p11.patch b/p11.patch new file mode 100644 index 00000000000000..3f26572790b47b --- /dev/null +++ b/p11.patch @@ -0,0 +1,32 @@ +--- + drivers/hsi/hsi.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/hsi/hsi.c ++++ b/drivers/hsi/hsi.c +@@ -33,11 +33,13 @@ static ssize_t modalias_show(struct devi + { + return sprintf(buf, "hsi:%s\n", dev_name(dev)); + } ++static DEVICE_ATTR_RO(modalias); + +-static struct device_attribute hsi_bus_dev_attrs[] = { +- __ATTR_RO(modalias), +- __ATTR_NULL, ++static struct attribute *hsi_bus_dev_attrs[] = { ++ &dev_attr_modalias.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(hsi_bus_dev); + + static int hsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env) + { +@@ -53,7 +55,7 @@ static int hsi_bus_match(struct device * + + static struct bus_type hsi_bus_type = { + .name = "hsi", +- .dev_attrs = hsi_bus_dev_attrs, ++ .dev_groups = hsi_bus_dev_groups, + .match = hsi_bus_match, + .uevent = hsi_bus_uevent, + }; diff --git a/p12.patch b/p12.patch new file mode 100644 index 00000000000000..0c101b44b21180 --- /dev/null +++ b/p12.patch @@ -0,0 +1,52 @@ +--- + drivers/input/gameport/gameport.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +--- a/drivers/input/gameport/gameport.c ++++ b/drivers/input/gameport/gameport.c +@@ -422,14 +422,15 @@ static struct gameport *gameport_get_pen + * Gameport port operations + */ + +-static ssize_t gameport_show_description(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t gameport_description_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct gameport *gameport = to_gameport_port(dev); + + return sprintf(buf, "%s\n", gameport->name); + } ++static DEVICE_ATTR(description, S_IRUGO, gameport_description_show, NULL); + +-static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) ++static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) + { + struct gameport *gameport = to_gameport_port(dev); + struct device_driver *drv; +@@ -457,12 +458,14 @@ static ssize_t gameport_rebind_driver(st + + return error ? error : count; + } ++static DEVICE_ATTR_WO(drvctl); + +-static struct device_attribute gameport_device_attrs[] = { +- __ATTR(description, S_IRUGO, gameport_show_description, NULL), +- __ATTR(drvctl, S_IWUSR, NULL, gameport_rebind_driver), +- __ATTR_NULL ++static struct attribute *gameport_device_attrs[] = { ++ &dev_attr_description.attr, ++ &dev_attr_drvctl.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(gameport_device); + + static void gameport_release_port(struct device *dev) + { +@@ -750,7 +753,7 @@ static int gameport_bus_match(struct dev + + static struct bus_type gameport_bus = { + .name = "gameport", +- .dev_attrs = gameport_device_attrs, ++ .dev_groups = gameport_device_groups, + .drv_groups = gameport_driver_groups, + .match = gameport_bus_match, + .probe = gameport_driver_probe, diff --git a/p13.patch b/p13.patch new file mode 100644 index 00000000000000..50d4136058a5ba --- /dev/null +++ b/p13.patch @@ -0,0 +1,32 @@ +--- + drivers/spi/spi.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -58,11 +58,13 @@ modalias_show(struct device *dev, struct + + return sprintf(buf, "%s%s\n", SPI_MODULE_PREFIX, spi->modalias); + } ++static DEVICE_ATTR_RO(modalias); + +-static struct device_attribute spi_dev_attrs[] = { +- __ATTR_RO(modalias), +- __ATTR_NULL, ++static struct attribute *spi_dev_attrs[] = { ++ &dev_attr_modalias.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(spi_dev); + + /* modalias support makes "modprobe $MODALIAS" new-style hotplug work, + * and the sysfs version makes coldplug work too. +@@ -229,7 +231,7 @@ static const struct dev_pm_ops spi_pm = + + struct bus_type spi_bus_type = { + .name = "spi", +- .dev_attrs = spi_dev_attrs, ++ .dev_groups = spi_dev_groups, + .match = spi_match_device, + .uevent = spi_uevent, + .pm = &spi_pm, diff --git a/p14.patch b/p14.patch new file mode 100644 index 00000000000000..15aef414c81510 --- /dev/null +++ b/p14.patch @@ -0,0 +1,74 @@ +--- + drivers/virtio/virtio.c | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +--- a/drivers/virtio/virtio.c ++++ b/drivers/virtio/virtio.c +@@ -13,18 +13,24 @@ static ssize_t device_show(struct device + struct virtio_device *dev = dev_to_virtio(_d); + return sprintf(buf, "0x%04x\n", dev->id.device); + } ++static DEVICE_ATTR_RO(device); ++ + static ssize_t vendor_show(struct device *_d, + struct device_attribute *attr, char *buf) + { + struct virtio_device *dev = dev_to_virtio(_d); + return sprintf(buf, "0x%04x\n", dev->id.vendor); + } ++static DEVICE_ATTR_RO(vendor); ++ + static ssize_t status_show(struct device *_d, + struct device_attribute *attr, char *buf) + { + struct virtio_device *dev = dev_to_virtio(_d); + return sprintf(buf, "0x%08x\n", dev->config->get_status(dev)); + } ++static DEVICE_ATTR_RO(status); ++ + static ssize_t modalias_show(struct device *_d, + struct device_attribute *attr, char *buf) + { +@@ -32,6 +38,8 @@ static ssize_t modalias_show(struct devi + return sprintf(buf, "virtio:d%08Xv%08X\n", + dev->id.device, dev->id.vendor); + } ++static DEVICE_ATTR_RO(modalias); ++ + static ssize_t features_show(struct device *_d, + struct device_attribute *attr, char *buf) + { +@@ -47,14 +55,17 @@ static ssize_t features_show(struct devi + len += sprintf(buf+len, "\n"); + return len; + } +-static struct device_attribute virtio_dev_attrs[] = { +- __ATTR_RO(device), +- __ATTR_RO(vendor), +- __ATTR_RO(status), +- __ATTR_RO(modalias), +- __ATTR_RO(features), +- __ATTR_NULL ++static DEVICE_ATTR_RO(features); ++ ++static struct attribute *virtio_dev_attrs[] = { ++ &dev_attr_device.attr, ++ &dev_attr_vendor.attr, ++ &dev_attr_status.attr, ++ &dev_attr_modalias.attr, ++ &dev_attr_features.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(virtio_dev); + + static inline int virtio_id_match(const struct virtio_device *dev, + const struct virtio_device_id *id) +@@ -165,7 +176,7 @@ static int virtio_dev_remove(struct devi + static struct bus_type virtio_bus = { + .name = "virtio", + .match = virtio_dev_match, +- .dev_attrs = virtio_dev_attrs, ++ .dev_groups = virtio_dev_groups, + .uevent = virtio_uevent, + .probe = virtio_dev_probe, + .remove = virtio_dev_remove, diff --git a/p15.patch b/p15.patch new file mode 100644 index 00000000000000..40afa69b45d3a3 --- /dev/null +++ b/p15.patch @@ -0,0 +1,28 @@ +--- + drivers/misc/tifm_core.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/misc/tifm_core.c ++++ b/drivers/misc/tifm_core.c +@@ -145,15 +145,17 @@ static ssize_t type_show(struct device * + struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); + return sprintf(buf, "%x", sock->type); + } ++static DEVICE_ATTR_RO(type); + +-static struct device_attribute tifm_dev_attrs[] = { +- __ATTR(type, S_IRUGO, type_show, NULL), +- __ATTR_NULL ++static struct attribute *tifm_dev_attrs[] = { ++ &dev_attr_type.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(tifm_dev); + + static struct bus_type tifm_bus_type = { + .name = "tifm", +- .dev_attrs = tifm_dev_attrs, ++ .dev_groups = tifm_dev_groups, + .match = tifm_bus_match, + .uevent = tifm_uevent, + .probe = tifm_device_probe, diff --git a/p16.patch b/p16.patch new file mode 100644 index 00000000000000..0787a2dcb91eba --- /dev/null +++ b/p16.patch @@ -0,0 +1,40 @@ +--- + drivers/memstick/core/memstick.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/memstick/core/memstick.c ++++ b/drivers/memstick/core/memstick.c +@@ -153,24 +153,24 @@ static ssize_t name##_show(struct device + struct memstick_dev *card = container_of(dev, struct memstick_dev, \ + dev); \ + return sprintf(buf, format, card->id.name); \ +-} ++} \ ++static DEVICE_ATTR_RO(name); + + MEMSTICK_ATTR(type, "%02X"); + MEMSTICK_ATTR(category, "%02X"); + MEMSTICK_ATTR(class, "%02X"); + +-#define MEMSTICK_ATTR_RO(name) __ATTR(name, S_IRUGO, name##_show, NULL) +- +-static struct device_attribute memstick_dev_attrs[] = { +- MEMSTICK_ATTR_RO(type), +- MEMSTICK_ATTR_RO(category), +- MEMSTICK_ATTR_RO(class), +- __ATTR_NULL ++static struct attribute *memstick_dev_attrs[] = { ++ &dev_attr_type.attr, ++ &dev_attr_category.attr, ++ &dev_attr_class.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(memstick_dev); + + static struct bus_type memstick_bus_type = { + .name = "memstick", +- .dev_attrs = memstick_dev_attrs, ++ .dev_groups = memstick_dev_groups, + .match = memstick_bus_match, + .uevent = memstick_uevent, + .probe = memstick_device_probe, diff --git a/p17.patch b/p17.patch new file mode 100644 index 00000000000000..579db636b78bec --- /dev/null +++ b/p17.patch @@ -0,0 +1,97 @@ +--- + drivers/message/i2o/core.h | 2 +- + drivers/message/i2o/device.c | 32 +++++++++++++++++++++----------- + drivers/message/i2o/driver.c | 2 +- + 3 files changed, 23 insertions(+), 13 deletions(-) + +--- a/drivers/message/i2o/core.h ++++ b/drivers/message/i2o/core.h +@@ -33,7 +33,7 @@ extern int __init i2o_pci_init(void); + extern void __exit i2o_pci_exit(void); + + /* device */ +-extern struct device_attribute i2o_device_attrs[]; ++extern const struct attribute_group *i2o_device_groups[]; + + extern void i2o_device_remove(struct i2o_device *); + extern int i2o_device_parse_lct(struct i2o_controller *); +--- a/drivers/message/i2o/device.c ++++ b/drivers/message/i2o/device.c +@@ -138,45 +138,55 @@ static void i2o_device_release(struct de + } + + /** +- * i2o_device_show_class_id - Displays class id of I2O device ++ * class_id_show - Displays class id of I2O device + * @dev: device of which the class id should be displayed + * @attr: pointer to device attribute + * @buf: buffer into which the class id should be printed + * + * Returns the number of bytes which are printed into the buffer. + */ +-static ssize_t i2o_device_show_class_id(struct device *dev, +- struct device_attribute *attr, +- char *buf) ++static ssize_t class_id_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct i2o_device *i2o_dev = to_i2o_device(dev); + + sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id); + return strlen(buf) + 1; + } ++static DEVICE_ATTR_RO(class_id); + + /** +- * i2o_device_show_tid - Displays TID of I2O device ++ * tid_show - Displays TID of I2O device + * @dev: device of which the TID should be displayed + * @attr: pointer to device attribute + * @buf: buffer into which the TID should be printed + * + * Returns the number of bytes which are printed into the buffer. + */ +-static ssize_t i2o_device_show_tid(struct device *dev, +- struct device_attribute *attr, char *buf) ++static ssize_t tid_show(struct device *dev, struct device_attribute *attr, ++ char *buf) + { + struct i2o_device *i2o_dev = to_i2o_device(dev); + + sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid); + return strlen(buf) + 1; + } ++static DEVICE_ATTR_RO(tid); + + /* I2O device attributes */ +-struct device_attribute i2o_device_attrs[] = { +- __ATTR(class_id, S_IRUGO, i2o_device_show_class_id, NULL), +- __ATTR(tid, S_IRUGO, i2o_device_show_tid, NULL), +- __ATTR_NULL ++static struct attribute *i2o_device_attrs[] = { ++ &dev_attr_class_id.attr, ++ &dev_attr_tid.attr, ++ NULL, ++}; ++ ++static const struct attribute_group i2o_device_group = { ++ .attrs = i2o_device_attrs, ++}; ++ ++const struct attribute_group *i2o_device_groups[] = { ++ &i2o_device_group, ++ NULL, + }; + + /** +--- a/drivers/message/i2o/driver.c ++++ b/drivers/message/i2o/driver.c +@@ -62,7 +62,7 @@ static int i2o_bus_match(struct device * + struct bus_type i2o_bus_type = { + .name = "i2o", + .match = i2o_bus_match, +- .dev_attrs = i2o_device_attrs ++ .dev_groups = i2o_device_groups, + }; + + /** diff --git a/p18.patch b/p18.patch new file mode 100644 index 00000000000000..3bcaa2231a6b63 --- /dev/null +++ b/p18.patch @@ -0,0 +1,92 @@ +--- + arch/arm/mach-rpc/ecard.c | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +--- a/arch/arm/mach-rpc/ecard.c ++++ b/arch/arm/mach-rpc/ecard.c +@@ -761,19 +761,21 @@ static struct expansion_card *__init eca + return ec; + } + +-static ssize_t ecard_show_irq(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t irq_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%u\n", ec->irq); + } ++static DEVICE_ATTR_RO(irq); + +-static ssize_t ecard_show_dma(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t dma_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%u\n", ec->dma); + } ++static DEVICE_ATTR_RO(dma); + +-static ssize_t ecard_show_resources(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t resource_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct expansion_card *ec = ECARD_DEV(dev); + char *str = buf; +@@ -787,35 +789,39 @@ static ssize_t ecard_show_resources(stru + + return str - buf; + } ++static DEVICE_ATTR_RO(resource_show) + +-static ssize_t ecard_show_vendor(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t vendor_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%u\n", ec->cid.manufacturer); + } ++static DEVICE_ATTR_RO(vendor); + +-static ssize_t ecard_show_device(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t device_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%u\n", ec->cid.product); + } ++static DEVICE_ATTR_RO(device); + +-static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct expansion_card *ec = ECARD_DEV(dev); + return sprintf(buf, "%s\n", ec->easi ? "EASI" : "IOC"); + } ++static DEVICE_ATTR_RO(type); + +-static struct device_attribute ecard_dev_attrs[] = { +- __ATTR(device, S_IRUGO, ecard_show_device, NULL), +- __ATTR(dma, S_IRUGO, ecard_show_dma, NULL), +- __ATTR(irq, S_IRUGO, ecard_show_irq, NULL), +- __ATTR(resource, S_IRUGO, ecard_show_resources, NULL), +- __ATTR(type, S_IRUGO, ecard_show_type, NULL), +- __ATTR(vendor, S_IRUGO, ecard_show_vendor, NULL), +- __ATTR_NULL, ++static struct attribute *ecard_dev_attrs[] = { ++ &dev_attr_device.attr, ++ &dev_attr_dma.attr, ++ &dev_attr_irq.attr, ++ &dev_attr_resource.attr, ++ &dev_attr_type.attr, ++ &dev_attr_vendor.attr, ++ NULL, + }; +- ++ATTRIBUTE_GROUPS(ecard_dev); + + int ecard_request_resources(struct expansion_card *ec) + { +@@ -1120,7 +1126,7 @@ static int ecard_match(struct device *_d + + struct bus_type ecard_bus_type = { + .name = "ecard", +- .dev_attrs = ecard_dev_attrs, ++ .dev_groups = ecard_dev_groups, + .match = ecard_match, + .probe = ecard_drv_probe, + .remove = ecard_drv_remove, diff --git a/p19.patch b/p19.patch new file mode 100644 index 00000000000000..94bbb029dfd228 --- /dev/null +++ b/p19.patch @@ -0,0 +1,52 @@ +--- + arch/mips/sgi-ip22/ip22-gio.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/arch/mips/sgi-ip22/ip22-gio.c ++++ b/arch/mips/sgi-ip22/ip22-gio.c +@@ -182,6 +182,7 @@ static ssize_t modalias_show(struct devi + + return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; + } ++static DEVICE_ATTR_RO(modalias); + + static ssize_t name_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -191,6 +192,7 @@ static ssize_t name_show(struct device * + giodev = to_gio_device(dev); + return sprintf(buf, "%s", giodev->name); + } ++static DEVICE_ATTR_RO(name); + + static ssize_t id_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -200,13 +202,15 @@ static ssize_t id_show(struct device *de + giodev = to_gio_device(dev); + return sprintf(buf, "%x", giodev->id.id); + } ++static DEVICE_ATTR_RO(id); + +-static struct device_attribute gio_dev_attrs[] = { +- __ATTR_RO(modalias), +- __ATTR_RO(name), +- __ATTR_RO(id), +- __ATTR_NULL, ++static struct attribute *gio_dev_attrs[] = { ++ &dev_attr_modalias.attr, ++ &dev_attr_name.attr, ++ &dev_attr_id.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(gio_dev); + + static int gio_device_uevent(struct device *dev, struct kobj_uevent_env *env) + { +@@ -377,7 +381,7 @@ static void ip22_check_gio(int slotno, u + + static struct bus_type gio_bus_type = { + .name = "gio", +- .dev_attrs = gio_dev_attrs, ++ .dev_groups = gio_dev_groups, + .match = gio_bus_match, + .probe = gio_device_probe, + .remove = gio_device_remove, diff --git a/p20.patch b/p20.patch new file mode 100644 index 00000000000000..f78b06b95aa3fc --- /dev/null +++ b/p20.patch @@ -0,0 +1,50 @@ +--- + arch/parisc/kernel/drivers.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +--- a/arch/parisc/kernel/drivers.c ++++ b/arch/parisc/kernel/drivers.c +@@ -587,7 +587,8 @@ static ssize_t name##_show(struct device + { \ + struct parisc_device *padev = to_parisc_device(dev); \ + return sprintf(buf, format_string, padev->field); \ +-} ++} \ ++static DEVICE_ATTR_RO(name); + + #define pa_dev_attr_id(field, format) pa_dev_attr(field, id.field, format) + +@@ -601,22 +602,24 @@ static ssize_t modalias_show(struct devi + { + return make_modalias(dev, buf); + } ++static DEVICE_ATTR_RO(modalias); + +-static struct device_attribute parisc_device_attrs[] = { +- __ATTR_RO(irq), +- __ATTR_RO(hw_type), +- __ATTR_RO(rev), +- __ATTR_RO(hversion), +- __ATTR_RO(sversion), +- __ATTR_RO(modalias), +- __ATTR_NULL, ++static struct attribute *parisc_device_attrs[] = { ++ &dev_attr_irq.attr, ++ &dev_attr_hw_type.attr, ++ &dev_attr_rev.attr, ++ &dev_attr_hversion.attr, ++ &dev_attr_sversion.attr, ++ &dev_attr_modalias.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(parisc_device); + + struct bus_type parisc_bus_type = { + .name = "parisc", + .match = parisc_generic_match, + .uevent = parisc_uevent, +- .dev_attrs = parisc_device_attrs, ++ .dev_groups = parisc_device_groups, + .probe = parisc_driver_probe, + .remove = parisc_driver_remove, + }; diff --git a/p21.patch b/p21.patch new file mode 100644 index 00000000000000..55c4eef9ed6ac9 --- /dev/null +++ b/p21.patch @@ -0,0 +1,38 @@ +--- + arch/sparc/kernel/vio.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/arch/sparc/kernel/vio.c ++++ b/arch/sparc/kernel/vio.c +@@ -97,6 +97,7 @@ static ssize_t devspec_show(struct devic + + return sprintf(buf, "%s\n", str); + } ++static DEVICE_ATTR_RO(devspec); + + static ssize_t type_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -104,16 +105,18 @@ static ssize_t type_show(struct device * + struct vio_dev *vdev = to_vio_dev(dev); + return sprintf(buf, "%s\n", vdev->type); + } ++static DEVICE_ATTR_RO(type); + +-static struct device_attribute vio_dev_attrs[] = { +- __ATTR_RO(devspec), +- __ATTR_RO(type), +- __ATTR_NULL ++static struct attribute *vio_dev_attrs[] = { ++ &dev_attr_devspec.attr, ++ &dev_attr_type.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(vio_dev); + + static struct bus_type vio_bus_type = { + .name = "vio", +- .dev_attrs = vio_dev_attrs, ++ .dev_groups = vio_dev_groups, + .match = vio_bus_match, + .probe = vio_device_probe, + .remove = vio_device_remove, diff --git a/p22.patch b/p22.patch new file mode 100644 index 00000000000000..67b19a16419870 --- /dev/null +++ b/p22.patch @@ -0,0 +1,49 @@ +--- + drivers/amba/bus.c | 22 ++++++++++------------ + 1 file changed, 10 insertions(+), 12 deletions(-) + +--- a/drivers/amba/bus.c ++++ b/drivers/amba/bus.c +@@ -64,24 +64,22 @@ static ssize_t name##_show(struct device + { \ + struct amba_device *dev = to_amba_device(_dev); \ + return sprintf(buf, fmt, arg); \ +-} +- +-#define amba_attr(name,fmt,arg...) \ +-amba_attr_func(name,fmt,arg) \ +-static DEVICE_ATTR(name, S_IRUGO, name##_show, NULL) ++} \ ++static DEVICE_ATTR_RO(name); + + amba_attr_func(id, "%08x\n", dev->periphid); +-amba_attr(irq0, "%u\n", dev->irq[0]); +-amba_attr(irq1, "%u\n", dev->irq[1]); ++amba_attr_func(irq0, "%u\n", dev->irq[0]); ++amba_attr_func(irq1, "%u\n", dev->irq[1]); + amba_attr_func(resource, "\t%016llx\t%016llx\t%016lx\n", + (unsigned long long)dev->res.start, (unsigned long long)dev->res.end, + dev->res.flags); + +-static struct device_attribute amba_dev_attrs[] = { +- __ATTR_RO(id), +- __ATTR_RO(resource), +- __ATTR_NULL, ++static struct attribute *amba_dev_attrs[] = { ++ &dev_attr_id.attr, ++ &dev_attr_resource.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(amba_dev); + + #ifdef CONFIG_PM_SLEEP + +@@ -302,7 +300,7 @@ static const struct dev_pm_ops amba_pm = + */ + struct bus_type amba_bustype = { + .name = "amba", +- .dev_attrs = amba_dev_attrs, ++ .dev_groups = amba_dev_groups, + .match = amba_match, + .uevent = amba_uevent, + .pm = AMBA_PM, diff --git a/p23.patch b/p23.patch new file mode 100644 index 00000000000000..6e09808cf5201d --- /dev/null +++ b/p23.patch @@ -0,0 +1,50 @@ +--- + drivers/rpmsg/virtio_rpmsg_bus.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +--- a/drivers/rpmsg/virtio_rpmsg_bus.c ++++ b/drivers/rpmsg/virtio_rpmsg_bus.c +@@ -125,7 +125,8 @@ field##_show(struct device *dev, \ + struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); \ + \ + return sprintf(buf, format_string, rpdev->path); \ +-} ++} \ ++static DEVICE_ATTR_RO(field); + + /* for more info, see Documentation/ABI/testing/sysfs-bus-rpmsg */ + rpmsg_show_attr(name, id.name, "%s\n"); +@@ -148,15 +149,17 @@ static ssize_t modalias_show(struct devi + + return sprintf(buf, RPMSG_DEVICE_MODALIAS_FMT "\n", rpdev->id.name); + } ++static DEVICE_ATTR_RO(modalias); + +-static struct device_attribute rpmsg_dev_attrs[] = { +- __ATTR_RO(name), +- __ATTR_RO(modalias), +- __ATTR_RO(dst), +- __ATTR_RO(src), +- __ATTR_RO(announce), +- __ATTR_NULL ++static struct attribute *rpmsg_dev_attrs[] = { ++ &dev_attr_name.attr, ++ &dev_attr_modalias.attr, ++ &dev_attr_dst.attr, ++ &dev_attr_src.attr, ++ &dev_attr_announce.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(rpmsg_dev); + + /* rpmsg devices and drivers are matched using the service name */ + static inline int rpmsg_id_match(const struct rpmsg_channel *rpdev, +@@ -427,7 +430,7 @@ static int rpmsg_dev_remove(struct devic + static struct bus_type rpmsg_bus = { + .name = "rpmsg", + .match = rpmsg_dev_match, +- .dev_attrs = rpmsg_dev_attrs, ++ .dev_groups = rpmsg_dev_groups, + .uevent = rpmsg_uevent, + .probe = rpmsg_dev_probe, + .remove = rpmsg_dev_remove, diff --git a/p24.patch b/p24.patch new file mode 100644 index 00000000000000..a3030e1e1df797 --- /dev/null +++ b/p24.patch @@ -0,0 +1,68 @@ +--- + sound/aoa/soundbus/core.c | 2 +- + sound/aoa/soundbus/soundbus.h | 2 +- + sound/aoa/soundbus/sysfs.c | 23 +++++++++++++++++------ + 3 files changed, 19 insertions(+), 8 deletions(-) + +--- a/sound/aoa/soundbus/core.c ++++ b/sound/aoa/soundbus/core.c +@@ -160,7 +160,7 @@ static struct bus_type soundbus_bus_type + .suspend = soundbus_device_suspend, + .resume = soundbus_device_resume, + #endif +- .dev_attrs = soundbus_dev_attrs, ++ .dev_groups = soundbus_dev_groups, + }; + + int soundbus_add_one(struct soundbus_dev *dev) +--- a/sound/aoa/soundbus/soundbus.h ++++ b/sound/aoa/soundbus/soundbus.h +@@ -199,6 +199,6 @@ struct soundbus_driver { + extern int soundbus_register_driver(struct soundbus_driver *drv); + extern void soundbus_unregister_driver(struct soundbus_driver *drv); + +-extern struct device_attribute soundbus_dev_attrs[]; ++extern const struct attribute_group *soundbus_dev_groups[]; + + #endif /* __SOUNDBUS_H */ +--- a/sound/aoa/soundbus/sysfs.c ++++ b/sound/aoa/soundbus/sysfs.c +@@ -10,7 +10,8 @@ field##_show (struct device *dev, struct + { \ + struct soundbus_dev *mdev = to_soundbus_device (dev); \ + return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \ +-} ++} \ ++static DEVICE_ATTR_RO(field); + + static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -30,13 +31,23 @@ static ssize_t modalias_show(struct devi + + return length; + } ++static DEVICE_ATTR_RO(modalias); + + soundbus_config_of_attr (name, "%s\n"); + soundbus_config_of_attr (type, "%s\n"); + +-struct device_attribute soundbus_dev_attrs[] = { +- __ATTR_RO(name), +- __ATTR_RO(type), +- __ATTR_RO(modalias), +- __ATTR_NULL ++static struct attribute *soundbus_dev_attrs[] = { ++ &dev_attr_name.attr, ++ &dev_attr_type.attr, ++ &dev_attr_modalias.attr, ++ NULL, ++}; ++ ++static const struct attribute_group soundbus_dev_group = { ++ .attrs = soundbus_dev_attrs, ++}; ++ ++const struct attribute_group *soundbus_dev_groups[] = { ++ &soundbus_dev_group, ++ NULL, + }; diff --git a/p25.patch b/p25.patch new file mode 100644 index 00000000000000..a255f6fb519605 --- /dev/null +++ b/p25.patch @@ -0,0 +1,72 @@ +--- + drivers/sh/superhyway/superhyway-sysfs.c | 29 +++++++++++++++++++---------- + drivers/sh/superhyway/superhyway.c | 2 +- + include/linux/superhyway.h | 2 +- + 3 files changed, 21 insertions(+), 12 deletions(-) + +--- a/drivers/sh/superhyway/superhyway-sysfs.c ++++ b/drivers/sh/superhyway/superhyway-sysfs.c +@@ -19,7 +19,8 @@ static ssize_t name##_show(struct device + { \ + struct superhyway_device *s = to_superhyway_device(dev); \ + return sprintf(buf, fmt, s->field); \ +-} ++} \ ++static DEVICE_ATTR_RO(name); + + /* VCR flags */ + superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags); +@@ -32,14 +33,22 @@ superhyway_ro_attr(top_mb, "0x%02x\n", v + /* Misc */ + superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start); + +-struct device_attribute superhyway_dev_attrs[] = { +- __ATTR_RO(perr_flags), +- __ATTR_RO(merr_flags), +- __ATTR_RO(mod_vers), +- __ATTR_RO(mod_id), +- __ATTR_RO(bot_mb), +- __ATTR_RO(top_mb), +- __ATTR_RO(resource), +- __ATTR_NULL, ++static struct attribute *superhyway_dev_attrs[] = { ++ &dev_attr_perr_flags.attr, ++ &dev_attr_merr_flags.attr, ++ &dev_attr_mod_vers.attr, ++ &dev_attr_mod_id.attr, ++ &dev_attr_bot_mb.attr, ++ &dev_attr_top_mb.attr, ++ &dev_attr_resource.attr, ++ NULL, + }; + ++static const struct attribute_group superhyway_dev_group = { ++ .attrs = superhyway_dev_attrs, ++}; ++ ++const struct attribute_group *superhyway_dev_groups[] = { ++ &superhyway_dev_group, ++ NULL, ++}; +--- a/drivers/sh/superhyway/superhyway.c ++++ b/drivers/sh/superhyway/superhyway.c +@@ -209,7 +209,7 @@ struct bus_type superhyway_bus_type = { + .name = "superhyway", + .match = superhyway_bus_match, + #ifdef CONFIG_SYSFS +- .dev_attrs = superhyway_dev_attrs, ++ .dev_groups = superhyway_dev_groups, + #endif + .probe = superhyway_device_probe, + .remove = superhyway_device_remove, +--- a/include/linux/superhyway.h ++++ b/include/linux/superhyway.h +@@ -101,7 +101,7 @@ int superhyway_add_device(unsigned long + int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices); + + /* drivers/sh/superhyway/superhyway-sysfs.c */ +-extern struct device_attribute superhyway_dev_attrs[]; ++extern const struct attribute_group *superhyway_dev_groups[]; + + #endif /* __LINUX_SUPERHYWAY_H */ + diff --git a/p26.patch b/p26.patch new file mode 100644 index 00000000000000..c711df6ed9ad31 --- /dev/null +++ b/p26.patch @@ -0,0 +1,86 @@ +--- + drivers/macintosh/macio_asic.c | 4 ++-- + drivers/macintosh/macio_sysfs.c | 29 +++++++++++++++++++++-------- + 2 files changed, 23 insertions(+), 10 deletions(-) + +--- a/drivers/macintosh/macio_asic.c ++++ b/drivers/macintosh/macio_asic.c +@@ -132,7 +132,7 @@ static int macio_device_resume(struct de + return 0; + } + +-extern struct device_attribute macio_dev_attrs[]; ++extern const struct attribute_group *macio_dev_groups[]; + + struct bus_type macio_bus_type = { + .name = "macio", +@@ -143,7 +143,7 @@ struct bus_type macio_bus_type = { + .shutdown = macio_device_shutdown, + .suspend = macio_device_suspend, + .resume = macio_device_resume, +- .dev_attrs = macio_dev_attrs, ++ .dev_groups = macio_dev_groups, + }; + + static int __init macio_bus_driver_init(void) +--- a/drivers/macintosh/macio_sysfs.c ++++ b/drivers/macintosh/macio_sysfs.c +@@ -10,7 +10,8 @@ field##_show (struct device *dev, struct + { \ + struct macio_dev *mdev = to_macio_device (dev); \ + return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \ +-} ++} \ ++static DEVICE_ATTR_RO(field); + + static ssize_t + compatible_show (struct device *dev, struct device_attribute *attr, char *buf) +@@ -37,6 +38,7 @@ compatible_show (struct device *dev, str + + return length; + } ++static DEVICE_ATTR_RO(compatible); + + static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, + char *buf) +@@ -48,6 +50,7 @@ static ssize_t modalias_show (struct dev + + return len+1; + } ++static DEVICE_ATTR_RO(modalias); + + static ssize_t devspec_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -57,15 +60,25 @@ static ssize_t devspec_show(struct devic + ofdev = to_platform_device(dev); + return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); + } ++static DEVICE_ATTR_RO(devspec); + + macio_config_of_attr (name, "%s\n"); + macio_config_of_attr (type, "%s\n"); + +-struct device_attribute macio_dev_attrs[] = { +- __ATTR_RO(name), +- __ATTR_RO(type), +- __ATTR_RO(compatible), +- __ATTR_RO(modalias), +- __ATTR_RO(devspec), +- __ATTR_NULL ++static struct attribute *macio_dev_attrs[] = { ++ &dev_attr_name.attr, ++ &dev_attr_type.attr, ++ &dev_attr_compatible.attr, ++ &dev_attr_modalias.attr, ++ &dev_attr_devspec.attr, ++ NULL, ++}; ++ ++static const struct attribute_group macio_dev_group = { ++ .attrs = macio_dev_attrs, ++}; ++ ++const struct attribute_group *macio_dev_groups[] = { ++ &macio_dev_group, ++ NULL, + }; diff --git a/p27.patch b/p27.patch new file mode 100644 index 00000000000000..2d9ee69d48ec5a --- /dev/null +++ b/p27.patch @@ -0,0 +1,32 @@ +--- + arch/powerpc/platforms/ps3/system-bus.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/arch/powerpc/platforms/ps3/system-bus.c ++++ b/arch/powerpc/platforms/ps3/system-bus.c +@@ -471,11 +471,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 ps3_system_bus_dev_attrs[] = { +- __ATTR_RO(modalias), +- __ATTR_NULL, ++static struct attribute *ps3_system_bus_dev_attrs[] = { ++ &dev_attr_modalias.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(ps3_system_bus); + + struct bus_type ps3_system_bus_type = { + .name = "ps3_system_bus", +@@ -484,7 +486,7 @@ struct bus_type ps3_system_bus_type = { + .probe = ps3_system_bus_probe, + .remove = ps3_system_bus_remove, + .shutdown = ps3_system_bus_shutdown, +- .dev_attrs = ps3_system_bus_dev_attrs, ++ .dev_groups = ps3_system_bus_dev_groups, + }; + + static int __init ps3_system_bus_init(void) diff --git a/p28.patch b/p28.patch new file mode 100644 index 00000000000000..8b4f1f5da310fe --- /dev/null +++ b/p28.patch @@ -0,0 +1,52 @@ +--- + arch/powerpc/kernel/ibmebus.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/arch/powerpc/kernel/ibmebus.c ++++ b/arch/powerpc/kernel/ibmebus.c +@@ -389,6 +389,7 @@ static ssize_t devspec_show(struct devic + ofdev = to_platform_device(dev); + return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); + } ++static DEVICE_ATTR_RO(devspec); + + static ssize_t name_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -398,6 +399,7 @@ static ssize_t name_show(struct device * + ofdev = to_platform_device(dev); + return sprintf(buf, "%s\n", ofdev->dev.of_node->name); + } ++static DEVICE_ATTR_RO(name); + + static ssize_t modalias_show(struct device *dev, + struct device_attribute *attr, char *buf) +@@ -407,13 +409,15 @@ static ssize_t modalias_show(struct devi + buf[len+1] = 0; + return len+1; + } ++static DEVICE_ATTR_RO(modalias); + +-struct device_attribute ibmebus_bus_device_attrs[] = { +- __ATTR_RO(devspec), +- __ATTR_RO(name), +- __ATTR_RO(modalias), +- __ATTR_NULL ++static struct attribute *ibmebus_bus_device_attrs[] = { ++ &dev_attr_devspec.attr, ++ &dev_attr_name.attr, ++ &dev_attr_modalias.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(ibmebus_bus_device); + + #ifdef CONFIG_PM_SLEEP + static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) +@@ -720,7 +724,7 @@ struct bus_type ibmebus_bus_type = { + .probe = ibmebus_bus_device_probe, + .remove = ibmebus_bus_device_remove, + .shutdown = ibmebus_bus_device_shutdown, +- .dev_attrs = ibmebus_bus_device_attrs, ++ .dev_groups = ibmebus_bus_device_groups, + .pm = IBMEBUS_BUS_PM_OPS_PTR, + }; + EXPORT_SYMBOL(ibmebus_bus_type); @@ -63,3 +63,27 @@ p03.patch p04.patch p05.patch qlcnic_sysfs.patch +p06.patch +p07.patch +p08.patch +p09.patch +p10.patch +p11.patch +p12.patch +p13.patch +p14.patch +p15.patch +p16.patch +p17.patch +p18.patch +p19.patch +p20.patch +p21.patch +p22.patch +p23.patch +p24.patch +p25.patch +p26.patch +p27.patch +p28.patch +p29.patch |
