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

mfd: rn5t618: 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: Beniamino Galvani <b.galvani@gmail.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
f41206c9 d5623161

+2 -3
+2 -3
drivers/mfd/rn5t618.c
··· 78 78 return ret; 79 79 } 80 80 81 - ret = mfd_add_devices(&i2c->dev, -1, rn5t618_cells, 82 - ARRAY_SIZE(rn5t618_cells), NULL, 0, NULL); 81 + ret = devm_mfd_add_devices(&i2c->dev, -1, rn5t618_cells, 82 + ARRAY_SIZE(rn5t618_cells), NULL, 0, NULL); 83 83 if (ret) { 84 84 dev_err(&i2c->dev, "failed to add sub-devices: %d\n", ret); 85 85 return ret; ··· 102 102 pm_power_off = NULL; 103 103 } 104 104 105 - mfd_remove_devices(&i2c->dev); 106 105 return 0; 107 106 } 108 107