summaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-06 08:17:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-09 05:00:46 -0400
commit9f4ac349bd60ef463450a00aa5e19c67f5ad12e2 (patch)
treebddeb4b9812ed73292a9fea1de93dff28cf107df /drivers/sh
parent39afc7af152519cc3f41dfb4460701e7c00c3391 (diff)
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>
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/superhyway/superhyway-sysfs.c29
-rw-r--r--drivers/sh/superhyway/superhyway.c2
2 files changed, 20 insertions, 11 deletions
diff --git a/drivers/sh/superhyway/superhyway-sysfs.c b/drivers/sh/superhyway/superhyway-sysfs.c
index 55434330867b..774f31b564f8 100644
--- 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 *dev, struct device_attribute *attr, ch
19{ \ 19{ \
20 struct superhyway_device *s = to_superhyway_device(dev); \ 20 struct superhyway_device *s = to_superhyway_device(dev); \
21 return sprintf(buf, fmt, s->field); \ 21 return sprintf(buf, fmt, s->field); \
22} 22} \
23static DEVICE_ATTR_RO(name);
23 24
24/* VCR flags */ 25/* VCR flags */
25superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags); 26superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags);
@@ -32,14 +33,22 @@ superhyway_ro_attr(top_mb, "0x%02x\n", vcr.top_mb);
32/* Misc */ 33/* Misc */
33superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start); 34superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start);
34 35
35struct device_attribute superhyway_dev_attrs[] = { 36static struct attribute *superhyway_dev_attrs[] = {
36 __ATTR_RO(perr_flags), 37 &dev_attr_perr_flags.attr,
37 __ATTR_RO(merr_flags), 38 &dev_attr_merr_flags.attr,
38 __ATTR_RO(mod_vers), 39 &dev_attr_mod_vers.attr,
39 __ATTR_RO(mod_id), 40 &dev_attr_mod_id.attr,
40 __ATTR_RO(bot_mb), 41 &dev_attr_bot_mb.attr,
41 __ATTR_RO(top_mb), 42 &dev_attr_top_mb.attr,
42 __ATTR_RO(resource), 43 &dev_attr_resource.attr,
43 __ATTR_NULL, 44 NULL,
44}; 45};
45 46
47static const struct attribute_group superhyway_dev_group = {
48 .attrs = superhyway_dev_attrs,
49};
50
51const struct attribute_group *superhyway_dev_groups[] = {
52 &superhyway_dev_group,
53 NULL,
54};
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index bb1fb7712134..348836b90605 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -209,7 +209,7 @@ struct bus_type superhyway_bus_type = {
209 .name = "superhyway", 209 .name = "superhyway",
210 .match = superhyway_bus_match, 210 .match = superhyway_bus_match,
211#ifdef CONFIG_SYSFS 211#ifdef CONFIG_SYSFS
212 .dev_attrs = superhyway_dev_attrs, 212 .dev_groups = superhyway_dev_groups,
213#endif 213#endif
214 .probe = superhyway_device_probe, 214 .probe = superhyway_device_probe,
215 .remove = superhyway_device_remove, 215 .remove = superhyway_device_remove,