mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
devm_memremap: convert to return ERR_PTR
Make devm_memremap consistent with the error return scheme of devm_memremap_pages to remove special casing in the pmem driver. Cc: Christoph Hellwig <[email protected]> Cc: Ross Zwisler <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
parent
d741314fe8
commit
b36f47617f
2 changed files with 7 additions and 11 deletions
|
|
@ -150,19 +150,15 @@ static struct pmem_device *pmem_alloc(struct device *dev,
|
|||
return ERR_PTR(-EBUSY);
|
||||
}
|
||||
|
||||
if (pmem_should_map_pages(dev)) {
|
||||
void *addr = devm_memremap_pages(dev, res);
|
||||
|
||||
if (IS_ERR(addr))
|
||||
return addr;
|
||||
pmem->virt_addr = (void __pmem *) addr;
|
||||
} else {
|
||||
if (pmem_should_map_pages(dev))
|
||||
pmem->virt_addr = (void __pmem *) devm_memremap_pages(dev, res);
|
||||
else
|
||||
pmem->virt_addr = (void __pmem *) devm_memremap(dev,
|
||||
pmem->phys_addr, pmem->size,
|
||||
ARCH_MEMREMAP_PMEM);
|
||||
if (!pmem->virt_addr)
|
||||
return ERR_PTR(-ENXIO);
|
||||
}
|
||||
|
||||
if (IS_ERR(pmem->virt_addr))
|
||||
return (void __force *) pmem->virt_addr;
|
||||
|
||||
return pmem;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue