summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/da9052-i2c.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-01-10 15:09:56 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 18:46:30 +0100
commit4d75dd61dfb53eaa286c54fb121e5b51b106c272 (patch)
treedb0ac935269049c352493c9f5cedb332939cd02e /drivers/mfd/da9052-i2c.c
parentd48f411c10f2badaf88e6050cd3d3acd52197356 (diff)
mfd: Add missing regmap_exit to free a previously allocated da9052 register map
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/da9052-i2c.c')
-rw-r--r--drivers/mfd/da9052-i2c.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c
index 44b97c70a61..fdc2c6a74e6 100644
--- a/drivers/mfd/da9052-i2c.c
+++ b/drivers/mfd/da9052-i2c.c
@@ -74,14 +74,16 @@ static int __devinit da9052_i2c_probe(struct i2c_client *client,
ret = da9052_i2c_enable_multiwrite(da9052);
if (ret < 0)
- goto err;
+ goto err_regmap;
ret = da9052_device_init(da9052, id->driver_data);
if (ret != 0)
- goto err;
+ goto err_regmap;
return 0;
+err_regmap:
+ regmap_exit(da9052->regmap);
err:
kfree(da9052);
return ret;
@@ -92,6 +94,7 @@ static int da9052_i2c_remove(struct i2c_client *client)
struct da9052 *da9052 = i2c_get_clientdata(client);
da9052_device_exit(da9052);
+ regmap_exit(da9052->regmap);
kfree(da9052);
return 0;