diff options
Diffstat (limited to 'drivers/mfd/da9052-i2c.c')
-rw-r--r-- | drivers/mfd/da9052-i2c.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 44b97c70a61f..36b88e395499 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c | |||
@@ -74,24 +74,27 @@ static int __devinit da9052_i2c_probe(struct i2c_client *client, | |||
74 | 74 | ||
75 | ret = da9052_i2c_enable_multiwrite(da9052); | 75 | ret = da9052_i2c_enable_multiwrite(da9052); |
76 | if (ret < 0) | 76 | if (ret < 0) |
77 | goto err; | 77 | goto err_regmap; |
78 | 78 | ||
79 | ret = da9052_device_init(da9052, id->driver_data); | 79 | ret = da9052_device_init(da9052, id->driver_data); |
80 | if (ret != 0) | 80 | if (ret != 0) |
81 | goto err; | 81 | goto err_regmap; |
82 | 82 | ||
83 | return 0; | 83 | return 0; |
84 | 84 | ||
85 | err_regmap: | ||
86 | regmap_exit(da9052->regmap); | ||
85 | err: | 87 | err: |
86 | kfree(da9052); | 88 | kfree(da9052); |
87 | return ret; | 89 | return ret; |
88 | } | 90 | } |
89 | 91 | ||
90 | static int da9052_i2c_remove(struct i2c_client *client) | 92 | static int __devexit da9052_i2c_remove(struct i2c_client *client) |
91 | { | 93 | { |
92 | struct da9052 *da9052 = i2c_get_clientdata(client); | 94 | struct da9052 *da9052 = i2c_get_clientdata(client); |
93 | 95 | ||
94 | da9052_device_exit(da9052); | 96 | da9052_device_exit(da9052); |
97 | regmap_exit(da9052->regmap); | ||
95 | kfree(da9052); | 98 | kfree(da9052); |
96 | 99 | ||
97 | return 0; | 100 | return 0; |
@@ -107,7 +110,7 @@ static struct i2c_device_id da9052_i2c_id[] = { | |||
107 | 110 | ||
108 | static struct i2c_driver da9052_i2c_driver = { | 111 | static struct i2c_driver da9052_i2c_driver = { |
109 | .probe = da9052_i2c_probe, | 112 | .probe = da9052_i2c_probe, |
110 | .remove = da9052_i2c_remove, | 113 | .remove = __devexit_p(da9052_i2c_remove), |
111 | .id_table = da9052_i2c_id, | 114 | .id_table = da9052_i2c_id, |
112 | .driver = { | 115 | .driver = { |
113 | .name = "da9052", | 116 | .name = "da9052", |