lib: devres: provide devm_ioremap_resource_wc()

Provide a variant of devm_ioremap_resource() for write-combined ioremap.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20191022084318.22256-4-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Bartosz Golaszewski 2019-10-22 10:43:13 +02:00 committed by Greg Kroah-Hartman
parent 6e92482275
commit b873af620e
3 changed files with 18 additions and 0 deletions

View File

@ -316,6 +316,7 @@ IOMAP
devm_ioremap_nocache()
devm_ioremap_wc()
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
devm_ioremap_resource_wc()
devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device
devm_iounmap()
pcim_iomap()

View File

@ -962,6 +962,8 @@ extern void devm_free_pages(struct device *dev, unsigned long addr);
void __iomem *devm_ioremap_resource(struct device *dev,
const struct resource *res);
void __iomem *devm_ioremap_resource_wc(struct device *dev,
const struct resource *res);
void __iomem *devm_of_iomap(struct device *dev,
struct device_node *node, int index,

View File

@ -169,6 +169,21 @@ void __iomem *devm_ioremap_resource(struct device *dev,
}
EXPORT_SYMBOL(devm_ioremap_resource);
/**
* devm_ioremap_resource_wc() - write-combined variant of
* devm_ioremap_resource()
* @dev: generic device to handle the resource for
* @res: resource to be handled
*
* Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
* on failure. Usage example:
*/
void __iomem *devm_ioremap_resource_wc(struct device *dev,
const struct resource *res)
{
return __devm_ioremap_resource(dev, res, DEVM_IOREMAP_WC);
}
/*
* devm_of_iomap - Requests a resource and maps the memory mapped IO
* for a given device_node managed by a given device