aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2018-07-11 11:17:39 -0400
committerSudeep Holla <sudeep.holla@arm.com>2018-07-12 13:06:01 -0400
commitcc4aecc5b724b47df65ef3e218ac7d73d2ee4e09 (patch)
treeb32d8d154200b26f9ce028fe5ad0cb852644d8ef
parentce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff)
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> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r--drivers/misc/vexpress-syscfg.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c
index 80a6f199077c..6c3591cdf855 100644
--- a/drivers/misc/vexpress-syscfg.c
+++ b/drivers/misc/vexpress-syscfg.c
@@ -258,13 +258,9 @@ static int vexpress_syscfg_probe(struct platform_device *pdev)
258 INIT_LIST_HEAD(&syscfg->funcs); 258 INIT_LIST_HEAD(&syscfg->funcs);
259 259
260 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 260 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
261 if (!devm_request_mem_region(&pdev->dev, res->start, 261 syscfg->base = devm_ioremap_resource(&pdev->dev, res);
262 resource_size(res), pdev->name)) 262 if (IS_ERR(syscfg->base))
263 return -EBUSY; 263 return PTR_ERR(syscfg->base);
264
265 syscfg->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
266 if (!syscfg->base)
267 return -EFAULT;
268 264
269 /* Must use dev.parent (MFD), as that's where DT phandle points at... */ 265 /* Must use dev.parent (MFD), as that's where DT phandle points at... */
270 bridge = vexpress_config_bridge_register(pdev->dev.parent, 266 bridge = vexpress_config_bridge_register(pdev->dev.parent,