aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2010-09-24 17:36:49 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:16:44 -0400
commitead454feb6cbfe0fa6a1eeb30aa9abc338dacf62 (patch)
treecb3ffe169218a0d923f4e7d642850e74874f7f76 /drivers/base
parent7a868088ee48d1816c10f9be6d32aef4cf30bcf7 (diff)
driver core: fix build for CONFIG_BLOCK not enabled
Fix build errors when CONFIG_BLOCK is not enabled: drivers/base/core.c: In function 'get_device_parent': drivers/base/core.c:634: error: 'block_class' undeclared (first use in this function) drivers/base/core.c: In function 'device_add_class_symlinks': drivers/base/core.c:723: error: 'block_class' undeclared (first use in this function) drivers/base/core.c: In function 'device_remove_class_symlinks': drivers/base/core.c:751: error: 'block_class' undeclared (first use in this function) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index f7f906f0a2f2..2cb49a93b1e6 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -630,12 +630,14 @@ static struct kobject *get_device_parent(struct device *dev,
630 struct kobject *parent_kobj; 630 struct kobject *parent_kobj;
631 struct kobject *k; 631 struct kobject *k;
632 632
633#ifdef CONFIG_BLOCK
633 /* block disks show up in /sys/block */ 634 /* block disks show up in /sys/block */
634 if (sysfs_deprecated && dev->class == &block_class) { 635 if (sysfs_deprecated && dev->class == &block_class) {
635 if (parent && parent->class == &block_class) 636 if (parent && parent->class == &block_class)
636 return &parent->kobj; 637 return &parent->kobj;
637 return &block_class.p->class_subsys.kobj; 638 return &block_class.p->class_subsys.kobj;
638 } 639 }
640#endif
639 641
640 /* 642 /*
641 * If we have no parent, we live in "virtual". 643 * If we have no parent, we live in "virtual".
@@ -719,9 +721,11 @@ static int device_add_class_symlinks(struct device *dev)
719 goto out_subsys; 721 goto out_subsys;
720 } 722 }
721 723
724#ifdef CONFIG_BLOCK
722 /* /sys/block has directories and does not need symlinks */ 725 /* /sys/block has directories and does not need symlinks */
723 if (sysfs_deprecated && dev->class == &block_class) 726 if (sysfs_deprecated && dev->class == &block_class)
724 return 0; 727 return 0;
728#endif
725 729
726 /* link in the class directory pointing to the device */ 730 /* link in the class directory pointing to the device */
727 error = sysfs_create_link(&dev->class->p->class_subsys.kobj, 731 error = sysfs_create_link(&dev->class->p->class_subsys.kobj,
@@ -748,8 +752,10 @@ static void device_remove_class_symlinks(struct device *dev)
748 if (dev->parent && device_is_not_partition(dev)) 752 if (dev->parent && device_is_not_partition(dev))
749 sysfs_remove_link(&dev->kobj, "device"); 753 sysfs_remove_link(&dev->kobj, "device");
750 sysfs_remove_link(&dev->kobj, "subsystem"); 754 sysfs_remove_link(&dev->kobj, "subsystem");
755#ifdef CONFIG_BLOCK
751 if (sysfs_deprecated && dev->class == &block_class) 756 if (sysfs_deprecated && dev->class == &block_class)
752 return; 757 return;
758#endif
753 sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev)); 759 sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
754} 760}
755 761