Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: superhyway: use dev_groups and not dev_attrs for bus_type

The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-sh@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+21 -12
+19 -10
drivers/sh/superhyway/superhyway-sysfs.c
··· 19 19 { \ 20 20 struct superhyway_device *s = to_superhyway_device(dev); \ 21 21 return sprintf(buf, fmt, s->field); \ 22 - } 22 + } \ 23 + static DEVICE_ATTR_RO(name); 23 24 24 25 /* VCR flags */ 25 26 superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags); ··· 33 32 /* Misc */ 34 33 superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start); 35 34 36 - struct device_attribute superhyway_dev_attrs[] = { 37 - __ATTR_RO(perr_flags), 38 - __ATTR_RO(merr_flags), 39 - __ATTR_RO(mod_vers), 40 - __ATTR_RO(mod_id), 41 - __ATTR_RO(bot_mb), 42 - __ATTR_RO(top_mb), 43 - __ATTR_RO(resource), 44 - __ATTR_NULL, 35 + static struct attribute *superhyway_dev_attrs[] = { 36 + &dev_attr_perr_flags.attr, 37 + &dev_attr_merr_flags.attr, 38 + &dev_attr_mod_vers.attr, 39 + &dev_attr_mod_id.attr, 40 + &dev_attr_bot_mb.attr, 41 + &dev_attr_top_mb.attr, 42 + &dev_attr_resource.attr, 43 + NULL, 45 44 }; 46 45 46 + static const struct attribute_group superhyway_dev_group = { 47 + .attrs = superhyway_dev_attrs, 48 + }; 49 + 50 + const struct attribute_group *superhyway_dev_groups[] = { 51 + &superhyway_dev_group, 52 + NULL, 53 + };
+1 -1
drivers/sh/superhyway/superhyway.c
··· 209 209 .name = "superhyway", 210 210 .match = superhyway_bus_match, 211 211 #ifdef CONFIG_SYSFS 212 - .dev_attrs = superhyway_dev_attrs, 212 + .dev_groups = superhyway_dev_groups, 213 213 #endif 214 214 .probe = superhyway_device_probe, 215 215 .remove = superhyway_device_remove,
+1 -1
include/linux/superhyway.h
··· 101 101 int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices); 102 102 103 103 /* drivers/sh/superhyway/superhyway-sysfs.c */ 104 - extern struct device_attribute superhyway_dev_attrs[]; 104 + extern const struct attribute_group *superhyway_dev_groups[]; 105 105 106 106 #endif /* __LINUX_SUPERHYWAY_H */ 107 107