mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
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>
This commit is contained in:
parent
571806a9f7
commit
72f8c0bfa0
3 changed files with 55 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue