lib: devres: add convenience function to remap a resource
authorWolfram Sang <w.sang@pengutronix.de>
Tue, 25 Oct 2011 13:16:47 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 16 Nov 2011 00:07:39 +0000 (16:07 -0800)
commit72f8c0bfa0de64c68ee59f40eb9b2683bffffbb0
tree44fa0c66dbb41d9154e170d4d97455e5665a5f12
parent571806a9f70fc4a4c575ab796555dfb401c2dfc1
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>
Documentation/driver-model/devres.txt
include/linux/device.h
lib/devres.c