Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
[sfrench/cifs-2.6.git] / drivers / zorro / zorro.c
index dff16d9767d86a740a1ad8da9563ec09c9902688..d45fb34e2d2371f49b26bfd0f787ac0cb5ddf06b 100644 (file)
@@ -130,6 +130,7 @@ static int __init zorro_init(void)
 {
     struct zorro_dev *z;
     unsigned int i;
+    int error;
 
     if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
        return 0;
@@ -139,8 +140,12 @@ static int __init zorro_init(void)
 
     /* Initialize the Zorro bus */
     INIT_LIST_HEAD(&zorro_bus.devices);
-    strcpy(zorro_bus.dev.bus_id, "zorro");
-    device_register(&zorro_bus.dev);
+    dev_set_name(&zorro_bus.dev, "zorro");
+    error = device_register(&zorro_bus.dev);
+    if (error) {
+       pr_err("Zorro: Error registering zorro_bus\n");
+       return error;
+    }
 
     /* Request the resources */
     zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
@@ -160,15 +165,19 @@ static int __init zorro_init(void)
        zorro_name_device(z);
        z->resource.name = z->name;
        if (request_resource(zorro_find_parent_resource(z), &z->resource))
-           printk(KERN_ERR "Zorro: Address space collision on device %s "
-                  "[%lx:%lx]\n",
-                  z->name, (unsigned long)zorro_resource_start(z),
-                  (unsigned long)zorro_resource_end(z));
-       sprintf(z->dev.bus_id, "%02x", i);
+           pr_err("Zorro: Address space collision on device %s %pR\n",
+                  z->name, &z->resource);
+       dev_set_name(&z->dev, "%02x", i);
        z->dev.parent = &zorro_bus.dev;
        z->dev.bus = &zorro_bus_type;
-       device_register(&z->dev);
-       zorro_create_sysfs_dev_files(z);
+       error = device_register(&z->dev);
+       if (error) {
+           pr_err("Zorro: Error registering device %s\n", z->name);
+           continue;
+       }
+       error = zorro_create_sysfs_dev_files(z);
+       if (error)
+           dev_err(&z->dev, "Error creating sysfs files\n");
     }
 
     /* Mark all available Zorro II memory */