diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f79efb359215..7ae9740c483d 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1383,16 +1383,13 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | |||
1383 | return -EBUSY; | 1383 | return -EBUSY; |
1384 | } | 1384 | } |
1385 | bdevname(rdev->bdev,b); | 1385 | bdevname(rdev->bdev,b); |
1386 | if (kobject_set_name(&rdev->kobj, "dev-%s", b) < 0) | 1386 | while ( (s=strchr(b, '/')) != NULL) |
1387 | return -ENOMEM; | ||
1388 | while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL) | ||
1389 | *s = '!'; | 1387 | *s = '!'; |
1390 | 1388 | ||
1391 | rdev->mddev = mddev; | 1389 | rdev->mddev = mddev; |
1392 | printk(KERN_INFO "md: bind<%s>\n", b); | 1390 | printk(KERN_INFO "md: bind<%s>\n", b); |
1393 | 1391 | ||
1394 | rdev->kobj.parent = &mddev->kobj; | 1392 | if ((err = kobject_add_ng(&rdev->kobj, &mddev->kobj, "dev-%s", b))) |
1395 | if ((err = kobject_add(&rdev->kobj))) | ||
1396 | goto fail; | 1393 | goto fail; |
1397 | 1394 | ||
1398 | if (rdev->bdev->bd_part) | 1395 | if (rdev->bdev->bd_part) |
@@ -2036,9 +2033,7 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi | |||
2036 | if (err) | 2033 | if (err) |
2037 | goto abort_free; | 2034 | goto abort_free; |
2038 | 2035 | ||
2039 | rdev->kobj.parent = NULL; | 2036 | kobject_init_ng(&rdev->kobj, &rdev_ktype); |
2040 | rdev->kobj.ktype = &rdev_ktype; | ||
2041 | kobject_init(&rdev->kobj); | ||
2042 | 2037 | ||
2043 | rdev->desc_nr = -1; | 2038 | rdev->desc_nr = -1; |
2044 | rdev->saved_raid_disk = -1; | 2039 | rdev->saved_raid_disk = -1; |