aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hikey9xx
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-09-18 17:33:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-22 09:49:34 +0200
commitdbbc8fdf2ad57629436bcdb421c2d4ad9aa1974f (patch)
tree6a23a7991a5c18891eb907df654a1d65ccd1fefb /drivers/staging/hikey9xx
parentstaging/emxx_udc: fix indenting issue on a couple of statements (diff)
downloadlinux-dev-dbbc8fdf2ad57629436bcdb421c2d4ad9aa1974f.tar.xz
linux-dev-dbbc8fdf2ad57629436bcdb421c2d4ad9aa1974f.zip
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: 70f59c90c819 ("staging: spmi: add Hikey 970 SPMI controller driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200918143338.GE909725@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/hikey9xx')
-rw-r--r--drivers/staging/hikey9xx/hisi-spmi-controller.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/hikey9xx/hisi-spmi-controller.c b/drivers/staging/hikey9xx/hisi-spmi-controller.c
index 5ffe79f45d9a..f831c43f4783 100644
--- a/drivers/staging/hikey9xx/hisi-spmi-controller.c
+++ b/drivers/staging/hikey9xx/hisi-spmi-controller.c
@@ -281,7 +281,8 @@ static int spmi_controller_probe(struct platform_device *pdev)
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) {
dev_err(&pdev->dev, "can not remap base addr!\n");
return -EADDRNOTAVAIL;