forked from Minki/linux
misc: vexpress/syscfg: Use devm_ioremap_resource() to map memory
Instead of checking the return value of platform_get_resource(), we can use devm_ioremap_resource() which has the NULL pointer check and the memory region requesting. devm_ioremap_resource is designed to replace calls to devm_request_mem_region followed by devm_ioremap, so let's use the same. Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3772e5da44
commit
555e7943f2
@ -258,13 +258,9 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
|
|||||||
INIT_LIST_HEAD(&syscfg->funcs);
|
INIT_LIST_HEAD(&syscfg->funcs);
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!devm_request_mem_region(&pdev->dev, res->start,
|
syscfg->base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
resource_size(res), pdev->name))
|
if (IS_ERR(syscfg->base))
|
||||||
return -EBUSY;
|
return PTR_ERR(syscfg->base);
|
||||||
|
|
||||||
syscfg->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
|
|
||||||
if (!syscfg->base)
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
/* Must use dev.parent (MFD), as that's where DT phandle points at... */
|
/* Must use dev.parent (MFD), as that's where DT phandle points at... */
|
||||||
bridge = vexpress_config_bridge_register(pdev->dev.parent,
|
bridge = vexpress_config_bridge_register(pdev->dev.parent,
|
||||||
|
Loading…
Reference in New Issue
Block a user