aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-17 14:54:39 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:29 -0500
commit3830c62fef49f8bb1b2f353c7fb9469e3d038f5d (patch)
treef9af151ea91d1bc91cdc1a66d35171e0aa26e08f /drivers/md/md.c
parentc199790a8bc90c91b88ad1205dee2955401cff81 (diff)
Kobject: change drivers/md/md.c to use kobject_init_and_add
Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Neil Brown <neilb@suse.de> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index cef9ebd5a046..c5030863d004 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3054,6 +3054,7 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
3054 int partitioned = (MAJOR(dev) != MD_MAJOR); 3054 int partitioned = (MAJOR(dev) != MD_MAJOR);
3055 int shift = partitioned ? MdpMinorShift : 0; 3055 int shift = partitioned ? MdpMinorShift : 0;
3056 int unit = MINOR(dev) >> shift; 3056 int unit = MINOR(dev) >> shift;
3057 int error;
3057 3058
3058 if (!mddev) 3059 if (!mddev)
3059 return NULL; 3060 return NULL;
@@ -3082,12 +3083,13 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
3082 add_disk(disk); 3083 add_disk(disk);
3083 mddev->gendisk = disk; 3084 mddev->gendisk = disk;
3084 mutex_unlock(&disks_mutex); 3085 mutex_unlock(&disks_mutex);
3085 mddev->kobj.parent = &disk->kobj; 3086 error = kobject_init_and_add(&mddev->kobj, &md_ktype, &disk->kobj,
3086 kobject_set_name(&mddev->kobj, "%s", "md"); 3087 "%s", "md");
3087 mddev->kobj.ktype = &md_ktype; 3088 if (error)
3088 if (kobject_register(&mddev->kobj))
3089 printk(KERN_WARNING "md: cannot register %s/md - name in use\n", 3089 printk(KERN_WARNING "md: cannot register %s/md - name in use\n",
3090 disk->disk_name); 3090 disk->disk_name);
3091 else
3092 kobject_uevent(&mddev->kobj, KOBJ_ADD);
3091 return NULL; 3093 return NULL;
3092} 3094}
3093 3095