diff options
author | Wolfram Sang | 2011-10-25 15:16:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2011-11-16 01:07:39 +0100 |
commit | 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0 (patch) | |
tree | 44fa0c66dbb41d9154e170d4d97455e5665a5f12 /include/linux/device.h | |
parent | lib: devres: add annotations for #endif (diff) | |
download | kernel-qcow2-linux-72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0.tar.gz kernel-qcow2-linux-72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0.tar.xz kernel-qcow2-linux-72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0.zip |
lib: devres: add convenience function to remap a resource
Almost every platform_driver does the three steps get_resource,
request_mem_region, ioremap. This does not only lead to a lot of code
duplication, but also a huge number of similar error strings and
inconsistent error codes on failure. So, introduce a helper function
which simplifies remapping a resource and make it hard to do something
wrong and add documentation for it.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index ffbcf95cd97d..c6335982774c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -490,6 +490,9 @@ extern int devres_release_group(struct device *dev, void *id); extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); extern void devm_kfree(struct device *dev, void *p); +void __iomem *devm_request_and_ioremap(struct device *dev, + struct resource *res); + struct device_dma_parameters { /* * a low level driver may set these to teach IOMMU code about |