lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 12 Jun 2015 11:07:26 +0200
From:	Quentin Lambert <lambert.quentin@...il.com>
To:	Simon Horman <horms@...ge.net.au>,
	Magnus Damm <magnus.damm@...il.com>, linux-sh@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc:	kernel-janitors@...r.kernel.org,
	Quentin Lambert <lambert.quentin@...il.com>
Subject: [PATCH] superhyway: convert code to use dev_groups

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@...il.com>
---
 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 linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ