Merge branch 'for-2.6.37' of git://linux-nfs.org/~bfields/linux
[pandora-kernel.git] / drivers / base / core.c
index f7f906f..6ed6454 100644 (file)
@@ -233,7 +233,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                                 __func__, retval);
        }
 
-       /* have the device type specific fuction add its stuff */
+       /* have the device type specific function add its stuff */
        if (dev->type && dev->type->uevent) {
                retval = dev->type->uevent(dev, env);
                if (retval)
@@ -630,12 +630,14 @@ static struct kobject *get_device_parent(struct device *dev,
                struct kobject *parent_kobj;
                struct kobject *k;
 
+#ifdef CONFIG_BLOCK
                /* block disks show up in /sys/block */
                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".
@@ -719,9 +721,11 @@ static int device_add_class_symlinks(struct device *dev)
                        goto out_subsys;
        }
 
+#ifdef CONFIG_BLOCK
        /* /sys/block has directories and does not need symlinks */
        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,
@@ -748,8 +752,10 @@ static void device_remove_class_symlinks(struct device *dev)
        if (dev->parent && device_is_not_partition(dev))
                sysfs_remove_link(&dev->kobj, "device");
        sysfs_remove_link(&dev->kobj, "subsystem");
+#ifdef CONFIG_BLOCK
        if (sysfs_deprecated && dev->class == &block_class)
                return;
+#endif
        sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
 }