]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/base/class.c
sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor
[linux-2.6-omap-h63xx.git] / drivers / base / class.c
index e085af0ff94fb93007e7dce12f98443e4c5daa6d..71ce3ff6bdf53261af4cc41e5763846803569f27 100644 (file)
@@ -148,6 +148,10 @@ int class_register(struct class *cls)
        if (error)
                return error;
 
+       /* set the default /sys/dev directory for devices of this class */
+       if (!cls->dev_kobj)
+               cls->dev_kobj = sysfs_dev_char_kobj;
+
 #if defined(CONFIG_SYSFS_DEPRECATED) && defined(CONFIG_BLOCK)
        /* let the block class directory show up in the root of sysfs */
        if (cls != &block_class)