summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:40 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:40 +0200
commit93ca1de96a7f293189db3682fe8fedf856d6b6a1 (patch)
treef7e466936ff00c854141e2d0a6bdcc2feb073af6
parent27f9ff5ab47354f933348663af30b9a28435c11b (diff)
downloadbarebox-93ca1de96a7f293189db3682fe8fedf856d6b6a1.tar.gz
barebox-93ca1de96a7f293189db3682fe8fedf856d6b6a1.tar.xz
svn_rev_291
add get_first_device() function
-rw-r--r--include/driver.h1
-rw-r--r--lib_generic/misc.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index 0a4e71ca79..81b10594cb 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -76,6 +76,7 @@ struct device_d *device_from_spec_str(const char *str, char **endp);
struct device_d *get_device_by_name(char *name);
struct device_d *get_device_by_type(ulong type, struct device_d *last);
struct device_d *get_device_by_id(const char *id);
+struct device_d *get_first_device(const char *id);
struct driver_d *get_driver_by_name(char *name);
diff --git a/lib_generic/misc.c b/lib_generic/misc.c
index 69df57649e..aa777a9523 100644
--- a/lib_generic/misc.c
+++ b/lib_generic/misc.c
@@ -34,6 +34,11 @@ int cmd_get_data_size(char* arg, int default_size)
static struct device_d *first_device = NULL;
static struct driver_d *first_driver = NULL;
+struct device_d *get_first_device(void)
+{
+ return first_device;
+}
+
struct device_d *get_device_by_id(const char *_id)
{
struct device_d *d;