Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: rk808: Use devm_mfd_add_devices() for mfd_device registration

Use devm_mfd_add_devices() for MFD devices registration and remove
the call of mfd_remove_devices() from .remove callback to remove
MFD child-devices. This is done by managed device framework.

CC: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Laxman Dewangan and committed by
Lee Jones
d5623161 7360544c

+3 -4
+3 -4
drivers/mfd/rk808.c
··· 213 213 rk808->i2c = client; 214 214 i2c_set_clientdata(client, rk808); 215 215 216 - ret = mfd_add_devices(&client->dev, -1, 217 - rk808s, ARRAY_SIZE(rk808s), 218 - NULL, 0, regmap_irq_get_domain(rk808->irq_data)); 216 + ret = devm_mfd_add_devices(&client->dev, -1, 217 + rk808s, ARRAY_SIZE(rk808s), NULL, 0, 218 + regmap_irq_get_domain(rk808->irq_data)); 219 219 if (ret) { 220 220 dev_err(&client->dev, "failed to add MFD devices %d\n", ret); 221 221 goto err_irq; ··· 240 240 struct rk808 *rk808 = i2c_get_clientdata(client); 241 241 242 242 regmap_del_irq_chip(client->irq, rk808->irq_data); 243 - mfd_remove_devices(&client->dev); 244 243 pm_power_off = NULL; 245 244 246 245 return 0;