switches=       [HW,M68k]
 
+       sysfs.deprecated=0|1 [KNL]
+                       Enable/disable old style sysfs layout for old udev
+                       on older distributions. When this option is enabled
+                       very new udev will not work anymore. When this option
+                       is disabled (or CONFIG_SYSFS_DEPRECATED not compiled)
+                       in older udev will not work anymore.
+                       Default depends on CONFIG_SYSFS_DEPRECATED_V2 set in
+                       the kernel configuration.
+
        sysrq_always_enabled
                        [KNL]
                        Ignore sysrq setting - this boot parameter will
 
 #include "blk.h"
 
 static DEFINE_MUTEX(block_class_lock);
-#ifndef CONFIG_SYSFS_DEPRECATED
 struct kobject *block_depr;
-#endif
 
 /* for extended dynamic devt allocation, currently only one major is used */
 #define MAX_EXT_DEVT           (1 << MINORBITS)
 
        register_blkdev(BLOCK_EXT_MAJOR, "blkext");
 
-#ifndef CONFIG_SYSFS_DEPRECATED
        /* create top-level block dir */
-       block_depr = kobject_create_and_add("block", NULL);
-#endif
+       if (!sysfs_deprecated)
+               block_depr = kobject_create_and_add("block", NULL);
        return 0;
 }
 
 
        if (!cls->dev_kobj)
                cls->dev_kobj = sysfs_dev_char_kobj;
 
-#if defined(CONFIG_SYSFS_DEPRECATED) && defined(CONFIG_BLOCK)
+#if defined(CONFIG_BLOCK)
        /* let the block class directory show up in the root of sysfs */
-       if (cls != &block_class)
+       if (!sysfs_deprecated || cls != &block_class)
                cp->class_subsys.kobj.kset = class_kset;
 #else
        cp->class_subsys.kobj.kset = class_kset;
 
 #include "base.h"
 #include "power/power.h"
 
+#ifdef CONFIG_SYSFS_DEPRECATED
+#ifdef CONFIG_SYSFS_DEPRECATED_V2
+long sysfs_deprecated = 1;
+#else
+long sysfs_deprecated = 0;
+#endif
+static __init int sysfs_deprecated_setup(char *arg)
+{
+       return strict_strtol(arg, 10, &sysfs_deprecated);
+}
+early_param("sysfs.deprecated", sysfs_deprecated_setup);
+#endif
+
 int (*platform_notify)(struct device *dev) = NULL;
 int (*platform_notify_remove)(struct device *dev) = NULL;
 static struct kobject *dev_kobj;
                struct kobject *parent_kobj;
                struct kobject *k;
 
-#ifdef CONFIG_SYSFS_DEPRECATED
                /* block disks show up in /sys/block */
-               if (dev->class == &block_class) {
+               if (sysfs_deprecated && dev->class == &block_class) {
                        if (parent && parent->class == &block_class)
                                return &parent->kobj;
                        return &block_class.p->class_subsys.kobj;
                }
-#endif
+
                /*
                 * If we have no parent, we live in "virtual".
                 * Class-devices with a non class-device as parent, live
                        goto out_subsys;
        }
 
-#ifdef CONFIG_SYSFS_DEPRECATED
        /* /sys/block has directories and does not need symlinks */
-       if (dev->class == &block_class)
+       if (sysfs_deprecated && dev->class == &block_class)
                return 0;
-#endif
 
        /* link in the class directory pointing to the device */
        error = sysfs_create_link(&dev->class->p->class_subsys.kobj,
        if (dev->parent && device_is_not_partition(dev))
                sysfs_remove_link(&dev->kobj, "device");
        sysfs_remove_link(&dev->kobj, "subsystem");
-#ifdef CONFIG_SYSFS_DEPRECATED
-       if (dev->class == &block_class)
+       if (sysfs_deprecated && dev->class == &block_class)
                return;
-#endif
        sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
 }
 
 
 
        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);
 
        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));
 }
 
        MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
 #define MODULE_ALIAS_CHARDEV_MAJOR(major) \
        MODULE_ALIAS("char-major-" __stringify(major) "-*")
+
+#ifdef CONFIG_SYSFS_DEPRECATED
+extern long sysfs_deprecated;
+#else
+#define sysfs_deprecated 0
+#endif
+
 #endif /* _DEVICE_H_ */
 
        depends on SYSFS
        default n
        help
-         This option switches the layout of the "block" class devices, to not
-         show up in /sys/class/block/, but only in /sys/block/.
+         This option adds code that switches the layout of the "block" class
+         devices, to not show up in /sys/class/block/, but only in
+         /sys/block/.
+
+         This switch is only active when the sysfs.deprecated=1 boot option is
+         passed or the SYSFS_DEPRECATED_V2 option is set.
 
          This option allows new kernels to run on old distributions and tools,
          which might get confused by /sys/class/block/. Since 2007/2008 all
          option enabled.
 
          Only if you are using a new kernel on an old distribution, you might
-         need to say Y here. Never say Y, if the original kernel, that came
-         with your distribution, has not set this option.
+         need to say Y here.
+
+config SYSFS_DEPRECATED_V2
+       bool "enabled deprecated sysfs features by default"
+       default n
+       depends on SYSFS
+       depends on SYSFS_DEPRECATED
+       help
+         Enable deprecated sysfs by default.
+
+         See the CONFIG_SYSFS_DEPRECATED option for more details about this
+         option.
+
+         Only if you are using a new kernel on an old distribution, you might
+         need to say Y here. Even then, odds are you would not need it
+         enabled, you can always pass the boot option if absolutely necessary.
 
 config RELAY
        bool "Kernel->user space relay support (formerly relayfs)"