Commit dbbc8fdf authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: spmi: hisi-spmi-controller: Use devm_ version of ioremap().

The ioremap() was never unmapped in the probe error handling or in the
remove function.  The fix is to use the devm_ioremap() function so it
gets cleaned up automatically.

Fixes: 70f59c90 ("staging: spmi: add Hikey 970 SPMI controller driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200918143338.GE909725@mwandaSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e2bb57d2
...@@ -281,7 +281,8 @@ static int spmi_controller_probe(struct platform_device *pdev) ...@@ -281,7 +281,8 @@ static int spmi_controller_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
spmi_controller->base = ioremap(iores->start, resource_size(iores)); spmi_controller->base = devm_ioremap(&pdev->dev, iores->start,
resource_size(iores));
if (!spmi_controller->base) { if (!spmi_controller->base) {
dev_err(&pdev->dev, "can not remap base addr!\n"); dev_err(&pdev->dev, "can not remap base addr!\n");
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment