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>
This commit is contained in:
Axel Lin
2012-01-10 15:09:56 +08:00
committed by Samuel Ortiz
parent d48f411c10
commit 4d75dd61df
2 changed files with 9 additions and 3 deletions

View File

@@ -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;