summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2011-10-25 15:16:47 +0200
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-04-05 09:12:15 -0700
commit55ee2d30ce55df625daa45e823d633003dcdc12b (patch)
tree2306b4b7f54fb0d6cf14417071d545197fba04c5 /include
parentf1ac5721f3c665c611ebd981718c8e0101d3e8c7 (diff)
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> (cherry picked from mainline commit 72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0) Change-Id: I600c5200104e234d42ca396e50853133b3ab4b1f Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/94533 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index e838e143baa7..28c35f876b19 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -487,6 +487,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