From d5b96bdca994ab00de350fe698a7daa09292ab29 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 19 Jul 2011 08:34:33 +0200 Subject: device: Add a dev_request_mem_region function We might want to add real resource tracking later. Also The first resource may not be a IORESOURCE_MEM at all. For these reasons introduce a wrapper function for driver so that they do not have to fiddle with resources directly. Signed-off-by: Sascha Hauer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- include/driver.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/driver.h b/include/driver.h index ed3df16f7c..0fc254dbbc 100644 --- a/include/driver.h +++ b/include/driver.h @@ -188,6 +188,20 @@ static inline const char *dev_name(const struct device_d *dev) return dev_id(dev); } +/* + * get register base 'num' for a device + */ +void __iomem *dev_get_mem_region(struct device_d *dev, int num); + +/* + * exlusively request register base 'num' for a device + */ +static inline void __iomem *dev_request_mem_region(struct device_d *dev, int num) +{ + /* no resource tracking yet */ + return dev_get_mem_region(dev, num); +} + /* linear list over all available devices */ extern struct list_head device_list; -- cgit v1.2.3