summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-21 13:53:32 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-21 14:10:07 +0800
commit4b193e0755e6a3ca580dd08c4633b79312e72cd4 (patch)
tree782b87957788aa4898e123801fe933285c7c3840 /include
parent6ae6553e1a82923033d940bb44aa5048d78e16d4 (diff)
downloadbarebox-4b193e0755e6a3ca580dd08c4633b79312e72cd4.tar.gz
barebox-4b193e0755e6a3ca580dd08c4633b79312e72cd4.tar.xz
resource: introduce add_generic_device to register simple device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'include')
-rw-r--r--include/driver.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/driver.h b/include/driver.h
index 11c42fef43..738cfaee5a 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -203,10 +203,22 @@ static inline void __iomem *dev_request_mem_region(struct device_d *dev, int num
}
/*
+ * register a generic device
+ * with only one resource
+ */
+struct device_d *add_generic_device(const char* devname, int id, const char *resname,
+ resource_size_t start, resource_size_t size, unsigned int flags,
+ void *pdata);
+
+/*
* register a memory device
*/
-struct device_d *add_mem_device(const char *name, resource_size_t start,
- resource_size_t size, unsigned int flags);
+static inline struct device_d *add_mem_device(const char *name, resource_size_t start,
+ resource_size_t size, unsigned int flags)
+{
+ return add_generic_device("mem", -1, name, start, size,
+ IORESOURCE_MEM | flags, NULL);
+}
/* linear list over all available devices
*/