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>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Apr 2007 00:19:33 -0400
From:	Kyle McMartin <kyle@...isc-linux.org>
To:	davem@...emloft.net
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] sparc64: modalias support for of_device

Hi Dave,

Quick patch to add modalias support for of_device to arch/sparc64 so
sbus drivers can be automatically loaded (I hope :)

Untested, as I'm sparc-less at the moment.

Cheers,
	Kyle

diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index fb9bf1e..d00ed90 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -173,6 +173,19 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
 }
 EXPORT_SYMBOL(of_find_device_by_node);
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+			     char *buf)
+{
+	ssize_t len;
+	struct of_device *d = to_of_device(dev);
+	struct device_node *node = d->node;
+
+	len = sprintf(buf, "of:N%sT%sC%s\n",
+		      node->name, node->type, "*");
+
+	return len;
+}
+
 #ifdef CONFIG_PCI
 struct bus_type isa_bus_type = {
        .name	= "isa",
@@ -207,9 +220,15 @@ struct bus_type sbus_bus_type = {
 EXPORT_SYMBOL(sbus_bus_type);
 #endif
 
+static struct device_attribute of_dev_attrs[] = {
+	__ATTR_RO(modalias),
+	__ATTR_NULL
+};
+
 struct bus_type of_bus_type = {
        .name	= "of",
        .match	= of_platform_bus_match,
+       .dev_attrs	= of_dev_attrs,
        .probe	= of_device_probe,
        .remove	= of_device_remove,
        .suspend	= of_device_suspend,
-
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