diff options
Diffstat (limited to 'fs/partitions/check.c')
-rw-r--r-- | fs/partitions/check.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 30f46c2cb9d5..b81bfc016a05 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -537,14 +537,14 @@ void register_disk(struct gendisk *disk) | |||
537 | 537 | ||
538 | if (device_add(ddev)) | 538 | if (device_add(ddev)) |
539 | return; | 539 | return; |
540 | #ifndef CONFIG_SYSFS_DEPRECATED | 540 | if (!sysfs_deprecated) { |
541 | err = sysfs_create_link(block_depr, &ddev->kobj, | 541 | err = sysfs_create_link(block_depr, &ddev->kobj, |
542 | kobject_name(&ddev->kobj)); | 542 | kobject_name(&ddev->kobj)); |
543 | if (err) { | 543 | if (err) { |
544 | device_del(ddev); | 544 | device_del(ddev); |
545 | return; | 545 | return; |
546 | } | ||
546 | } | 547 | } |
547 | #endif | ||
548 | disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); | 548 | disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); |
549 | disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); | 549 | disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); |
550 | 550 | ||
@@ -766,8 +766,7 @@ void del_gendisk(struct gendisk *disk) | |||
766 | kobject_put(disk->part0.holder_dir); | 766 | kobject_put(disk->part0.holder_dir); |
767 | kobject_put(disk->slave_dir); | 767 | kobject_put(disk->slave_dir); |
768 | disk->driverfs_dev = NULL; | 768 | disk->driverfs_dev = NULL; |
769 | #ifndef CONFIG_SYSFS_DEPRECATED | 769 | if (!sysfs_deprecated) |
770 | sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk))); | 770 | sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk))); |
771 | #endif | ||
772 | device_del(disk_to_dev(disk)); | 771 | device_del(disk_to_dev(disk)); |
773 | } | 772 | } |