diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 10 |
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 | ||