]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SPARC64]: Unconditionally register vio_bus_type.
authorDavid S. Miller <davem@sunset.davemloft.net>
Sat, 14 Jul 2007 07:41:08 +0000 (00:41 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 16 Jul 2007 11:04:45 +0000 (04:04 -0700)
The VIO drivers register themselves unconditionally just
like those of any other bus type, so to avoid crashes
on non-VIO systems we need to always register vio_bus_type.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/vio.c

index 8b269aabff070c1dd4e3f1350293fb8764120e25..49569b44ea1fc7ef323ef95adf8c8c561feed1de 100644 (file)
@@ -335,6 +335,13 @@ static int __init vio_init(void)
        int err, len;
        u64 root;
 
+       err = bus_register(&vio_bus_type);
+       if (err) {
+               printk(KERN_ERR "VIO: Could not register bus type err=%d\n",
+                      err);
+               return err;
+       }
+
        hp = mdesc_grab();
        if (!hp)
                return 0;
@@ -374,13 +381,6 @@ static int __init vio_init(void)
 
        cdev_cfg_handle = *cfg_handle;
 
-       err = bus_register(&vio_bus_type);
-       if (err) {
-               printk(KERN_ERR "VIO: Could not register bus type err=%d\n",
-                      err);
-               return err;
-       }
-
        create_devices(hp, root);
 
        mdesc_release(hp);