linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>,
	Kay Sievers <kay.sievers@vrfy.org>,
	gregkh@suse.de
Cc: linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] driver core: fix build for CONFIG_BLOCK=n
Date: Mon, 20 Sep 2010 09:20:34 -0700	[thread overview]
Message-ID: <20100920092034.0b3f5898.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20100920161239.f204a507.sfr@canb.auug.org.au>

From: Randy Dunlap <randy.dunlap@oracle.com>

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 <randy.dunlap@oracle.com>
---
 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));
 }
 

  parent reply	other threads:[~2010-09-20 16:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20  6:12 linux-next: Tree for September 20 Stephen Rothwell
2010-09-20 16:18 ` linux-next: Tree for September 20 (scsi/pcmcia/nsp_cs.c) Randy Dunlap
2010-09-20 17:42   ` Dominik Brodowski
2010-09-20 16:20 ` Randy Dunlap [this message]
2010-09-21 22:31   ` [PATCH -next] driver core: fix build for CONFIG_BLOCK=n Greg KH
2010-09-23 17:57     ` Randy Dunlap
2010-09-23 18:15     ` Randy Dunlap
2010-09-23 19:16       ` Greg KH
2010-09-23 19:47         ` Randy Dunlap
2010-09-23 20:30           ` Greg KH
2010-09-23 20:34             ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100920092034.0b3f5898.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).