[PATCH] superhyway: convert code to use dev_groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The dev_attrs field of struct bus_type is going away, use dev_groups
instead. This converts the soundbus code to use the correct field.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert <lambert.quentin@xxxxxxxxx>
---
 drivers/sh/superhyway/superhyway-sysfs.c |   26 ++++++++++++++++----------
 drivers/sh/superhyway/superhyway.c       |    4 +++-
 include/linux/superhyway.h               |    2 +-
 3 files changed, 20 insertions(+), 12 deletions(-)

--- a/drivers/sh/superhyway/superhyway-sysfs.c
+++ b/drivers/sh/superhyway/superhyway-sysfs.c
@@ -23,23 +23,29 @@ static ssize_t name##_show(struct device
 
 /* VCR flags */
 superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags);
+static DEVICE_ATTR_RO(perr_flags);
 superhyway_ro_attr(merr_flags, "0x%02x\n", vcr.merr_flags);
+static DEVICE_ATTR_RO(merr_flags);
 superhyway_ro_attr(mod_vers, "0x%04x\n", vcr.mod_vers);
+static DEVICE_ATTR_RO(mod_vers);
 superhyway_ro_attr(mod_id, "0x%04x\n", vcr.mod_id);
+static DEVICE_ATTR_RO(mod_id);
 superhyway_ro_attr(bot_mb, "0x%02x\n", vcr.bot_mb);
+static DEVICE_ATTR_RO(bot_mb);
 superhyway_ro_attr(top_mb, "0x%02x\n", vcr.top_mb);
+static DEVICE_ATTR_RO(top_mb);
 
 /* Misc */
 superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start);
+static DEVICE_ATTR_RO(resource);
 
-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,
+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,
 };
-
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -205,11 +205,13 @@ static int superhyway_bus_match(struct d
 	return -ENODEV;
 }
 
+/* superhyway_dev_attrs is defined in superhyway-sysfs.c */
+ATTRIBUTE_GROUPS(superhyway_dev);
 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 struct attribute *superhyway_dev_attrs[];
 
 #endif /* __LINUX_SUPERHYWAY_H */
 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux