[patch] fix broken topology functions

From: Matthew Dobson (colpatch@us.ibm.com)
Date: Wed Dec 04 2002 - 18:54:07 EST


Linus,
        The register_(node|memblk)_driver functions are broken. Pat Mochel
recently updated sysfs to make sure that when you register a driver that
it's associated devclass is already registered. The way node/memblk
registration is done now is backwards and causes panic's on NUMA
systems. Please apply this patch to fix it.

Cheers!

-Matt

diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.50-vanilla/drivers/base/memblk.c linux-2.5.50-topo_ordering/drivers/base/memblk.c
--- linux-2.5.50-vanilla/drivers/base/memblk.c Wed Nov 27 14:36:23 2002
+++ linux-2.5.50-topo_ordering/drivers/base/memblk.c Wed Dec 4 15:50:52 2002
@@ -49,7 +49,7 @@
 
 static int __init register_memblk_type(void)
 {
- driver_register(&memblk_driver);
- return devclass_register(&memblk_devclass);
+ devclass_register(&memblk_devclass);
+ return driver_register(&memblk_driver);
 }
 postcore_initcall(register_memblk_type);
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.50-vanilla/drivers/base/node.c linux-2.5.50-topo_ordering/drivers/base/node.c
--- linux-2.5.50-vanilla/drivers/base/node.c Wed Nov 27 14:35:50 2002
+++ linux-2.5.50-topo_ordering/drivers/base/node.c Wed Dec 4 15:50:52 2002
@@ -93,7 +93,7 @@
 
 static int __init register_node_type(void)
 {
- driver_register(&node_driver);
- return devclass_register(&node_devclass);
+ devclass_register(&node_devclass);
+ return driver_register(&node_driver);
 }
 postcore_initcall(register_node_type);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:20 EST