From: Axel Lin Date: Tue, 10 Jan 2012 07:09:56 +0000 (+0800) Subject: mfd: Add missing regmap_exit to free a previously allocated da9052 register map X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4d75dd61dfb53eaa286c54fb121e5b51b106c272;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mfd: Add missing regmap_exit to free a previously allocated da9052 register map Signed-off-by: Axel Lin Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 44b97c70a61f..fdc2c6a74e62 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; diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c index cdbc7cad326f..76bb9ea0816e 100644 --- a/drivers/mfd/da9052-spi.c +++ b/drivers/mfd/da9052-spi.c @@ -52,10 +52,12 @@ static int da9052_spi_probe(struct spi_device *spi) 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; @@ -66,6 +68,7 @@ static int da9052_spi_remove(struct spi_device *spi) struct da9052 *da9052 = dev_get_drvdata(&spi->dev); da9052_device_exit(da9052); + regmap_exit(da9052->regmap); kfree(da9052); return 0;