mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
BackMerge v4.18-rc7 into drm-next
rmk requested this for armada and I think we've had a few conflicts build up. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
commit
3fce461827
865 changed files with 8464 additions and 4522 deletions
|
@ -3579,6 +3579,44 @@ void pci_unmap_iospace(struct resource *res)
|
|||
}
|
||||
EXPORT_SYMBOL(pci_unmap_iospace);
|
||||
|
||||
static void devm_pci_unmap_iospace(struct device *dev, void *ptr)
|
||||
{
|
||||
struct resource **res = ptr;
|
||||
|
||||
pci_unmap_iospace(*res);
|
||||
}
|
||||
|
||||
/**
|
||||
* devm_pci_remap_iospace - Managed pci_remap_iospace()
|
||||
* @dev: Generic device to remap IO address for
|
||||
* @res: Resource describing the I/O space
|
||||
* @phys_addr: physical address of range to be mapped
|
||||
*
|
||||
* Managed pci_remap_iospace(). Map is automatically unmapped on driver
|
||||
* detach.
|
||||
*/
|
||||
int devm_pci_remap_iospace(struct device *dev, const struct resource *res,
|
||||
phys_addr_t phys_addr)
|
||||
{
|
||||
const struct resource **ptr;
|
||||
int error;
|
||||
|
||||
ptr = devres_alloc(devm_pci_unmap_iospace, sizeof(*ptr), GFP_KERNEL);
|
||||
if (!ptr)
|
||||
return -ENOMEM;
|
||||
|
||||
error = pci_remap_iospace(res, phys_addr);
|
||||
if (error) {
|
||||
devres_free(ptr);
|
||||
} else {
|
||||
*ptr = res;
|
||||
devres_add(dev, ptr);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
EXPORT_SYMBOL(devm_pci_remap_iospace);
|
||||
|
||||
/**
|
||||
* devm_pci_remap_cfgspace - Managed pci_remap_cfgspace()
|
||||
* @dev: Generic device to remap IO address for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue