From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: [PATCH -next] driver core: fix build for CONFIG_BLOCK=n Date: Mon, 20 Sep 2010 09:20:34 -0700 Message-ID: <20100920092034.0b3f5898.randy.dunlap@oracle.com> References: <20100920161239.f204a507.sfr@canb.auug.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from rcsinet10.oracle.com ([148.87.113.121]:65308 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115Ab0ITQWo (ORCPT ); Mon, 20 Sep 2010 12:22:44 -0400 In-Reply-To: <20100920161239.f204a507.sfr@canb.auug.org.au> Sender: linux-next-owner@vger.kernel.org List-ID: To: Stephen Rothwell , Kay Sievers , gregkh@suse.de Cc: linux-next@vger.kernel.org, LKML From: Randy Dunlap Fix build when CONFIG_BLOCK is not enabled (since SEP-06). Fixes these build errors: drivers/base/core.c: In function 'get_device_parent': drivers/base/core.c:622: error: 'block_class' undeclared (first use in this function) drivers/base/core.c: In function 'device_add_class_symlinks': drivers/base/core.c:712: error: 'block_class' undeclared (first use in this function) drivers/base/core.c: In function 'device_remove_class_symlinks': drivers/base/core.c:742: error: 'block_class' undeclared (first use in this function) Signed-off-by: Randy Dunlap --- drivers/base/core.c | 6 ++++++ 1 file changed, 6 insertions(+) --- linux-next-20100920.orig/drivers/base/core.c +++ linux-next-20100920/drivers/base/core.c @@ -618,6 +618,7 @@ static struct kobject *get_device_parent struct kobject *k; #ifdef CONFIG_SYSFS_DEPRECATED +#ifdef CONFIG_BLOCK /* block disks show up in /sys/block */ if (dev->class == &block_class) { if (parent && parent->class == &block_class) @@ -625,6 +626,7 @@ static struct kobject *get_device_parent return &block_class.p->class_subsys.kobj; } #endif +#endif /* * If we have no parent, we live in "virtual". * Class-devices with a non class-device as parent, live @@ -708,10 +710,12 @@ static int device_add_class_symlinks(str } #ifdef CONFIG_SYSFS_DEPRECATED +#ifdef CONFIG_BLOCK /* /sys/block has directories and does not need symlinks */ if (dev->class == &block_class) return 0; #endif +#endif /* link in the class directory pointing to the device */ error = sysfs_create_link(&dev->class->p->class_subsys.kobj, @@ -739,9 +743,11 @@ static void device_remove_class_symlinks sysfs_remove_link(&dev->kobj, "device"); sysfs_remove_link(&dev->kobj, "subsystem"); #ifdef CONFIG_SYSFS_DEPRECATED +#ifdef CONFIG_BLOCK if (dev->class == &block_class) return; #endif +#endif sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev)); }