aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeordan Neukum <gneukum1@gmail.com>2019-05-26 01:18:34 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-30 14:04:26 -0700
commit299672a74856fd840a3b3f207064480d5e4dc91d (patch)
treed627026959a995ea8df16c982d6b4014303573b4
parentstaging: kpc2000: kpc_i2c: fail probe if unable to map I/O space (diff)
staging: kpc2000: kpc_i2c: Use devm_* API to manage mapped I/O space
The kpc_i2c driver does not unmap its I/O space upon error cases in the probe() function or upon remove(). Make the driver clean up after itself more maintainably by using the managed resource API. Signed-off-by: Geordan Neukum <gneukum1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/kpc2000/kpc2000_i2c.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c
index 51e91653e183..a434dd0b78c4 100644
--- a/drivers/staging/kpc2000/kpc2000_i2c.c
+++ b/drivers/staging/kpc2000/kpc2000_i2c.c
@@ -590,7 +590,9 @@ static int pi2c_probe(struct platform_device *pldev)
if (!res)
return -ENXIO;
- priv->smba = (unsigned long)ioremap_nocache(res->start, resource_size(res));
+ priv->smba = (unsigned long)devm_ioremap_nocache(&pldev->dev,
+ res->start,
+ resource_size(res));
if (!priv->smba)
return -ENOMEM;