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

mfd: mt6397: 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: John Crispin <blogic@openwrt.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Laxman Dewangan and committed by
Lee Jones
08e380a5 7990ad17

+6 -12
+6 -12
drivers/mfd/mt6397-core.c
··· 276 276 pmic->int_con[1] = MT6323_INT_CON1; 277 277 pmic->int_status[0] = MT6323_INT_STATUS0; 278 278 pmic->int_status[1] = MT6323_INT_STATUS1; 279 - ret = mfd_add_devices(&pdev->dev, -1, mt6323_devs, 280 - ARRAY_SIZE(mt6323_devs), NULL, 0, NULL); 279 + ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs, 280 + ARRAY_SIZE(mt6323_devs), NULL, 281 + 0, NULL); 281 282 break; 282 283 283 284 case MT6397_CID_CODE: ··· 287 286 pmic->int_con[1] = MT6397_INT_CON1; 288 287 pmic->int_status[0] = MT6397_INT_STATUS0; 289 288 pmic->int_status[1] = MT6397_INT_STATUS1; 290 - ret = mfd_add_devices(&pdev->dev, -1, mt6397_devs, 291 - ARRAY_SIZE(mt6397_devs), NULL, 0, NULL); 289 + ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs, 290 + ARRAY_SIZE(mt6397_devs), NULL, 291 + 0, NULL); 292 292 break; 293 293 294 294 default: ··· 314 312 return ret; 315 313 } 316 314 317 - static int mt6397_remove(struct platform_device *pdev) 318 - { 319 - mfd_remove_devices(&pdev->dev); 320 - 321 - return 0; 322 - } 323 - 324 315 static const struct of_device_id mt6397_of_match[] = { 325 316 { .compatible = "mediatek,mt6397" }, 326 317 { .compatible = "mediatek,mt6323" }, ··· 329 334 330 335 static struct platform_driver mt6397_driver = { 331 336 .probe = mt6397_probe, 332 - .remove = mt6397_remove, 333 337 .driver = { 334 338 .name = "mt6397", 335 339 .of_match_table = of_match_ptr(mt6397_of_match),