diff -ruNPx autom4te.cache modutils-2.4.26/module-init-tools-3.0-pre10/depmod.c modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.c
--- modutils-2.4.26/module-init-tools-3.0-pre10/depmod.c	2005-06-28 16:42:42.000000000 -0400
+++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.c	2005-06-28 16:38:53.000000000 -0400
@@ -649,6 +649,7 @@
 	{ "modules.ieee1394map", output_ieee1394_table },
 	{ "modules.isapnpmap", output_isapnp_table },
 	{ "modules.inputmap", output_input_table },
+	{ "modules.ofmap", output_of_table },
 	{ "modules.alias", output_aliases },
 	{ "modules.symbols", output_symbols },
 };
diff -ruNPx autom4te.cache modutils-2.4.26/module-init-tools-3.0-pre10/depmod.h modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.h
--- modutils-2.4.26/module-init-tools-3.0-pre10/depmod.h	2003-12-23 21:10:57.000000000 -0500
+++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.h	2005-06-28 16:38:53.000000000 -0400
@@ -47,6 +47,8 @@
 	void *pnp_card_table;
 	unsigned int input_size;
 	void *input_table;
+	unsigned int of_size;
+	void *of_table;
 
 	/* File contents and length. */
 	void *data;
diff -ruNPx autom4te.cache modutils-2.4.26/module-init-tools-3.0-pre10/moduleops_core.c modutils-2.4.26.devel/module-init-tools-3.0-pre10/moduleops_core.c
--- modutils-2.4.26/module-init-tools-3.0-pre10/moduleops_core.c	2003-12-24 00:17:07.000000000 -0500
+++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/moduleops_core.c	2005-06-28 16:38:53.000000000 -0400
@@ -192,6 +192,11 @@
 	module->input_size = PERBIT(INPUT_DEVICE_SIZE);
 	module->input_table = PERBIT(deref_sym)(module->data,
 					"__mod_input_device_table");
+
+	module->of_size = PERBIT(OF_DEVICE_SIZE);
+	module->of_table = PERBIT(deref_sym)(module->data,
+					"__mod_of_device_table");
+
 }
 
 struct module_ops PERBIT(mod_ops) = {
diff -ruNPx autom4te.cache modutils-2.4.26/module-init-tools-3.0-pre10/tables.c modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.c
--- modutils-2.4.26/module-init-tools-3.0-pre10/tables.c	2003-12-24 00:23:38.000000000 -0500
+++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.c	2005-06-28 16:50:05.000000000 -0400
@@ -340,3 +340,57 @@
 		}
 	}
 }
+
+static void
+strip_whitespace (char *str, char chr)
+{
+	int i;
+	if (!str)
+		return;
+	for (i = strlen (str); i >= 0; --i)
+		if (isspace (*str))
+			*str = chr;
+}
+
+/* We set driver_data to zero */
+static void output_of_entry(struct of_device_id *dev, char *name, FILE *out)
+{
+	char *ofname = NULL, *type = NULL, *compatible = NULL;
+	if (dev->name[0]) {
+		ofname = strdup (dev->name);
+		strip_whitespace (ofname, '_');
+	}
+
+	if (dev->type[0]) {
+		type = strdup (dev->type);
+		strip_whitespace (type, '_');
+       }
+
+	if (dev->compatible[0]) {
+		compatible = strdup (dev->compatible);
+		strip_whitespace (compatible, '_');
+	}
+
+        fprintf (out, "%-20s %-20s %-20s %s\n",
+                name, ofname ? ofname : "*", type ? type : "*",
+                compatible ? compatible : "*");
+}
+
+void output_of_table(struct module *modules, FILE *out)
+{
+	struct module *i;
+
+        fprintf (out, "# of module          name                 type                 compatible\n");                                 
+	for (i = modules; i; i = i->next) {
+		struct of_device_id *e;
+		char shortname[strlen(i->pathname) + 1];
+
+		if (!i->of_table)
+			continue;
+
+		make_shortname(shortname, i->pathname);
+		for (e = i->of_table; e->name[0]|e->type[0]|e->compatible[0];
+                     e = (void *)e + i->of_size)
+			output_of_entry(e, shortname, out);
+	}
+}
diff -ruNPx autom4te.cache modutils-2.4.26/module-init-tools-3.0-pre10/tables.h modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.h
--- modutils-2.4.26/module-init-tools-3.0-pre10/tables.h	2003-12-24 00:18:54.000000000 -0500
+++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.h	2005-06-28 16:38:53.000000000 -0400
@@ -116,6 +116,15 @@
 #define INPUT_DEVICE_SIZE32 (4 + 4 * 2 + 4 + 16 * 4 + 4 + 2 * 4 + 4 + 4 + 4 + 4 * 4 + 4)
 #define INPUT_DEVICE_SIZE64 (8 + 4 * 2 + 8 + 8 * 8 + 8 + 8 + 8 + 8 + 8 + 2 * 8 + 8)
 
+struct of_device_id {
+	char name[32];
+	char type[32];
+	char compatible[128];
+};
+
+#define OF_DEVICE_SIZE32 (32 * 2 + 128 + 4)
+#define OF_DEVICE_SIZE64 (32 * 2 + 128 + 8)
+
 /* Functions provided by tables.c */
 struct module;
 void output_usb_table(struct module *modules, FILE *out);
@@ -124,5 +133,6 @@
 void output_ccw_table(struct module *modules, FILE *out);
 void output_isapnp_table(struct module *modules, FILE *out);
 void output_input_table(struct module *modules, FILE *out);
+void output_of_table(struct module *modules, FILE *out);
 
 #endif /* MODINITTOOLS_TABLES_H */
