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

mfd: lp3943: Use devm_mfd_add_devices() for mfd_device registration

Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Milo Kim <milo.kim@ti.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Laxman Dewangan and committed by
Lee Jones
c5f24454 9c384b02

+3 -11
+3 -11
drivers/mfd/lp3943.c
··· 123 123 lp3943->mux_cfg = lp3943_mux_cfg; 124 124 i2c_set_clientdata(cl, lp3943); 125 125 126 - return mfd_add_devices(dev, -1, lp3943_devs, ARRAY_SIZE(lp3943_devs), 127 - NULL, 0, NULL); 128 - } 129 - 130 - static int lp3943_remove(struct i2c_client *cl) 131 - { 132 - struct lp3943 *lp3943 = i2c_get_clientdata(cl); 133 - 134 - mfd_remove_devices(lp3943->dev); 135 - return 0; 126 + return devm_mfd_add_devices(dev, -1, lp3943_devs, 127 + ARRAY_SIZE(lp3943_devs), 128 + NULL, 0, NULL); 136 129 } 137 130 138 131 static const struct i2c_device_id lp3943_ids[] = { ··· 144 151 145 152 static struct i2c_driver lp3943_driver = { 146 153 .probe = lp3943_probe, 147 - .remove = lp3943_remove, 148 154 .driver = { 149 155 .name = "lp3943", 150 156 .of_match_table = of_match_ptr(lp3943_of_match),