diff options
Diffstat (limited to 'drivers/mfd/da9052-spi.c')
-rw-r--r-- | drivers/mfd/da9052-spi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c index cdbc7cad326f..6faf149e8d94 100644 --- a/drivers/mfd/da9052-spi.c +++ b/drivers/mfd/da9052-spi.c | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include <linux/mfd/da9052/da9052.h> | 22 | #include <linux/mfd/da9052/da9052.h> |
23 | 23 | ||
24 | static int da9052_spi_probe(struct spi_device *spi) | 24 | static int __devinit da9052_spi_probe(struct spi_device *spi) |
25 | { | 25 | { |
26 | int ret; | 26 | int ret; |
27 | const struct spi_device_id *id = spi_get_device_id(spi); | 27 | const struct spi_device_id *id = spi_get_device_id(spi); |
@@ -52,20 +52,23 @@ static int da9052_spi_probe(struct spi_device *spi) | |||
52 | 52 | ||
53 | ret = da9052_device_init(da9052, id->driver_data); | 53 | ret = da9052_device_init(da9052, id->driver_data); |
54 | if (ret != 0) | 54 | if (ret != 0) |
55 | goto err; | 55 | goto err_regmap; |
56 | 56 | ||
57 | return 0; | 57 | return 0; |
58 | 58 | ||
59 | err_regmap: | ||
60 | regmap_exit(da9052->regmap); | ||
59 | err: | 61 | err: |
60 | kfree(da9052); | 62 | kfree(da9052); |
61 | return ret; | 63 | return ret; |
62 | } | 64 | } |
63 | 65 | ||
64 | static int da9052_spi_remove(struct spi_device *spi) | 66 | static int __devexit da9052_spi_remove(struct spi_device *spi) |
65 | { | 67 | { |
66 | struct da9052 *da9052 = dev_get_drvdata(&spi->dev); | 68 | struct da9052 *da9052 = dev_get_drvdata(&spi->dev); |
67 | 69 | ||
68 | da9052_device_exit(da9052); | 70 | da9052_device_exit(da9052); |
71 | regmap_exit(da9052->regmap); | ||
69 | kfree(da9052); | 72 | kfree(da9052); |
70 | 73 | ||
71 | return 0; | 74 | return 0; |