Skip to content

Commit af8df94

Browse files
marexLee Jones
authored andcommitted
mfd: da9063: Replace mfd_add_devices with devm counterpart
Use devm_mfd_add_devices() instead of plain mfd_add_devices(), which removes the need for da9063_device_exit() altogether and also for the .remove callback in da9063-i2c.c . Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 7494de0 commit af8df94

3 files changed

Lines changed: 3 additions & 20 deletions

File tree

‎drivers/mfd/da9063-core.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,20 +226,15 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
226226

227227
da9063->irq_base = regmap_irq_chip_get_base(da9063->regmap_irq);
228228

229-
ret = mfd_add_devices(da9063->dev, -1, da9063_devs,
230-
ARRAY_SIZE(da9063_devs), NULL, da9063->irq_base,
231-
NULL);
229+
ret = devm_mfd_add_devices(da9063->dev, -1, da9063_devs,
230+
ARRAY_SIZE(da9063_devs), NULL,
231+
da9063->irq_base, NULL);
232232
if (ret)
233233
dev_err(da9063->dev, "Cannot add MFD cells\n");
234234

235235
return ret;
236236
}
237237

238-
void da9063_device_exit(struct da9063 *da9063)
239-
{
240-
mfd_remove_devices(da9063->dev);
241-
}
242-
243238
MODULE_DESCRIPTION("PMIC driver for Dialog DA9063");
244239
MODULE_AUTHOR("Krystian Garbaciak");
245240
MODULE_AUTHOR("Michal Hajduk");

‎drivers/mfd/da9063-i2c.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,6 @@ static int da9063_i2c_probe(struct i2c_client *i2c,
270270
return da9063_device_init(da9063, i2c->irq);
271271
}
272272

273-
static int da9063_i2c_remove(struct i2c_client *i2c)
274-
{
275-
struct da9063 *da9063 = i2c_get_clientdata(i2c);
276-
277-
da9063_device_exit(da9063);
278-
279-
return 0;
280-
}
281-
282273
static const struct i2c_device_id da9063_i2c_id[] = {
283274
{"da9063", PMIC_DA9063},
284275
{},
@@ -291,7 +282,6 @@ static struct i2c_driver da9063_i2c_driver = {
291282
.of_match_table = of_match_ptr(da9063_dt_ids),
292283
},
293284
.probe = da9063_i2c_probe,
294-
.remove = da9063_i2c_remove,
295285
.id_table = da9063_i2c_id,
296286
};
297287

‎include/linux/mfd/da9063/core.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,4 @@ struct da9063 {
9494
int da9063_device_init(struct da9063 *da9063, unsigned int irq);
9595
int da9063_irq_init(struct da9063 *da9063);
9696

97-
void da9063_device_exit(struct da9063 *da9063);
98-
9997
#endif /* __MFD_DA9063_CORE_H__ */

0 commit comments

Comments
 (0)