summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2010-11-01 09:26:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2010-11-01 11:44:48 +0100
commit6c7f4664009ddf70e21b1b07353cf14c7330ca8d (patch)
treed772d4a3985f8f42b90fcb3323aaec2ba20c09c3 /lib
parentbd8db893bb65e32952f8389d37f868e2c6f82d21 (diff)
downloadbarebox-6c7f4664009ddf70e21b1b07353cf14c7330ca8d.tar.gz
barebox-6c7f4664009ddf70e21b1b07353cf14c7330ca8d.tar.xz
devinfo: use subtree only with devinfo
The do_devinfo_subtree() function is only used if devinfo is compiled in, so put it under the same ifdef. This avoids the following warning when built with allnoconfig: lib/driver.c:247: warning: 'do_devinfo_subtree' defined but not used Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/driver.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/driver.c b/lib/driver.c
index edde1dc2ff..62ad88f403 100644
--- a/lib/driver.c
+++ b/lib/driver.c
@@ -244,6 +244,27 @@ int dummy_probe(struct device_d *dev)
}
EXPORT_SYMBOL(dummy_probe);
+const char *dev_id(const struct device_d *dev)
+{
+ static char buf[sizeof(unsigned long) * 2];
+
+ sprintf(buf, FORMAT_DRIVER_MANE_ID, dev->name, dev->id);
+
+ return buf;
+}
+
+void devices_shutdown(void)
+{
+ struct device_d *dev;
+
+ list_for_each_entry(dev, &active, active) {
+ if (dev->driver->remove)
+ dev->driver->remove(dev);
+ }
+}
+
+#ifdef CONFIG_CMD_DEVINFO
+
static int do_devinfo_subtree(struct device_d *dev, int depth, char edge)
{
struct device_d *child;
@@ -276,27 +297,6 @@ static int do_devinfo_subtree(struct device_d *dev, int depth, char edge)
return 0;
}
-const char *dev_id(const struct device_d *dev)
-{
- static char buf[sizeof(unsigned long) * 2];
-
- sprintf(buf, FORMAT_DRIVER_MANE_ID, dev->name, dev->id);
-
- return buf;
-}
-
-void devices_shutdown(void)
-{
- struct device_d *dev;
-
- list_for_each_entry(dev, &active, active) {
- if (dev->driver->remove)
- dev->driver->remove(dev);
- }
-}
-
-#ifdef CONFIG_CMD_DEVINFO
-
static int do_devinfo(struct command *cmdtp, int argc, char *argv[])
{
struct device_d *dev;