aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/tps65910-irq.c3
-rw-r--r--drivers/mfd/tps65910.c7
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mfd/tps65910-irq.c b/drivers/mfd/tps65910-irq.c
index a56be931551c..95c0d7978bec 100644
--- a/drivers/mfd/tps65910-irq.c
+++ b/drivers/mfd/tps65910-irq.c
@@ -215,6 +215,7 @@ int tps65910_irq_init(struct tps65910 *tps65910, int irq,
215 215
216int tps65910_irq_exit(struct tps65910 *tps65910) 216int tps65910_irq_exit(struct tps65910 *tps65910)
217{ 217{
218 free_irq(tps65910->chip_irq, tps65910); 218 if (tps65910->chip_irq)
219 free_irq(tps65910->chip_irq, tps65910);
219 return 0; 220 return 0;
220} 221}
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index c1da84bc1573..01cf5012a08f 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -172,15 +172,12 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
172 172
173 tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base); 173 tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base);
174 174
175 ret = tps65910_irq_init(tps65910, init_data->irq, init_data); 175 tps65910_irq_init(tps65910, init_data->irq, init_data);
176 if (ret < 0)
177 goto err;
178 176
179 kfree(init_data); 177 kfree(init_data);
180 return ret; 178 return ret;
181 179
182err: 180err:
183 mfd_remove_devices(tps65910->dev);
184 kfree(tps65910); 181 kfree(tps65910);
185 kfree(init_data); 182 kfree(init_data);
186 return ret; 183 return ret;
@@ -190,8 +187,8 @@ static int tps65910_i2c_remove(struct i2c_client *i2c)
190{ 187{
191 struct tps65910 *tps65910 = i2c_get_clientdata(i2c); 188 struct tps65910 *tps65910 = i2c_get_clientdata(i2c);
192 189
193 mfd_remove_devices(tps65910->dev);
194 tps65910_irq_exit(tps65910); 190 tps65910_irq_exit(tps65910);
191 mfd_remove_devices(tps65910->dev);
195 kfree(tps65910); 192 kfree(tps65910);
196 193
197 return 0; 194 return 0;