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

mfd: menf21bmc: 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.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Andreas Werner <andreas.werner@men.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Laxman Dewangan and committed by
Lee Jones
7990ad17 c5f24454

+2 -9
+2 -9
drivers/mfd/menf21bmc.c
··· 96 96 return ret; 97 97 } 98 98 99 - ret = mfd_add_devices(&client->dev, 0, menf21bmc_cell, 100 - ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL); 99 + ret = devm_mfd_add_devices(&client->dev, 0, menf21bmc_cell, 100 + ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL); 101 101 if (ret < 0) { 102 102 dev_err(&client->dev, "failed to add BMC sub-devices\n"); 103 103 return ret; 104 104 } 105 105 106 - return 0; 107 - } 108 - 109 - static int menf21bmc_remove(struct i2c_client *client) 110 - { 111 - mfd_remove_devices(&client->dev); 112 106 return 0; 113 107 } 114 108 ··· 116 122 .driver.name = "menf21bmc", 117 123 .id_table = menf21bmc_id_table, 118 124 .probe = menf21bmc_probe, 119 - .remove = menf21bmc_remove, 120 125 }; 121 126 122 127 module_i2c_driver(menf21bmc_driver);