Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
[linux-2.6.git] / fs / partitions / check.c
index 30f46c2..b81bfc0 100644 (file)
@@ -537,14 +537,14 @@ void register_disk(struct gendisk *disk)
 
        if (device_add(ddev))
                return;
-#ifndef CONFIG_SYSFS_DEPRECATED
-       err = sysfs_create_link(block_depr, &ddev->kobj,
-                               kobject_name(&ddev->kobj));
-       if (err) {
-               device_del(ddev);
-               return;
+       if (!sysfs_deprecated) {
+               err = sysfs_create_link(block_depr, &ddev->kobj,
+                                       kobject_name(&ddev->kobj));
+               if (err) {
+                       device_del(ddev);
+                       return;
+               }
        }
-#endif
        disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
        disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
 
@@ -766,8 +766,7 @@ void del_gendisk(struct gendisk *disk)
        kobject_put(disk->part0.holder_dir);
        kobject_put(disk->slave_dir);
        disk->driverfs_dev = NULL;
-#ifndef CONFIG_SYSFS_DEPRECATED
-       sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
-#endif
+       if (!sysfs_deprecated)
+               sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
        device_del(disk_to_dev(disk));
 }