]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/genhd.c
Driver Core: add kobj_attribute handling
[linux-2.6-omap-h63xx.git] / block / genhd.c
index e609996f2e766d7009d5984aa8b4fbc29c813bbf..32227b7ecd17b508073bbc12d5a295af9fa98719 100644 (file)
@@ -584,7 +584,7 @@ static struct kset_uevent_ops block_uevent_ops = {
        .uevent         = block_uevent,
 };
 
-decl_subsys(block, &ktype_block, &block_uevent_ops);
+decl_subsys(block, &block_uevent_ops);
 
 /*
  * aggregate disk stat collector.  Uses the same stats that the sysfs
@@ -715,12 +715,14 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
                        disk->part = kmalloc_node(size,
                                GFP_KERNEL | __GFP_ZERO, node_id);
                        if (!disk->part) {
+                               free_disk_stats(disk);
                                kfree(disk);
                                return NULL;
                        }
                }
                disk->minors = minors;
-               kobj_set_kset_s(disk,block_subsys);
+               disk->kobj.kset = &block_subsys;
+               disk->kobj.ktype = &ktype_block;
                kobject_init(&disk->kobj);
                rand_initialize_disk(disk);
                INIT_WORK(&disk->async_notify,