[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100924143649.59f0572a.randy.dunlap@oracle.com>
Date: Fri, 24 Sep 2010 14:36:49 -0700
From: Randy Dunlap <randy.dunlap@...cle.com>
To: Stephen Rothwell <sfr@...b.auug.org.au>, gregkh@...e.de
Cc: linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] driver core: fix build for CONFIG_BLOCK not enabled
From: Randy Dunlap <randy.dunlap@...cle.com>
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@...cle.com>
---
drivers/base/core.c | 6 ++++++
1 file changed, 6 insertions(+)
--- linux-next-20100924.orig/drivers/base/core.c
+++ linux-next-20100924/drivers/base/core.c
@@ -630,12 +630,14 @@ static struct kobject *get_device_parent
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(str
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
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));
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists