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

mfd: bcm590xx: 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: Matt Porter <mporter@linaro.org>
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
9148f2c0 f32fb9a5

+2 -9
+2 -9
drivers/mfd/bcm590xx.c
··· 82 82 goto err; 83 83 } 84 84 85 - ret = mfd_add_devices(&i2c_pri->dev, -1, bcm590xx_devs, 86 - ARRAY_SIZE(bcm590xx_devs), NULL, 0, NULL); 85 + ret = devm_mfd_add_devices(&i2c_pri->dev, -1, bcm590xx_devs, 86 + ARRAY_SIZE(bcm590xx_devs), NULL, 0, NULL); 87 87 if (ret < 0) { 88 88 dev_err(&i2c_pri->dev, "failed to add sub-devices: %d\n", ret); 89 89 goto err; ··· 94 94 err: 95 95 i2c_unregister_device(bcm590xx->i2c_sec); 96 96 return ret; 97 - } 98 - 99 - static int bcm590xx_i2c_remove(struct i2c_client *i2c) 100 - { 101 - mfd_remove_devices(&i2c->dev); 102 - return 0; 103 97 } 104 98 105 99 static const struct of_device_id bcm590xx_of_match[] = { ··· 114 120 .of_match_table = of_match_ptr(bcm590xx_of_match), 115 121 }, 116 122 .probe = bcm590xx_i2c_probe, 117 - .remove = bcm590xx_i2c_remove, 118 123 .id_table = bcm590xx_i2c_id, 119 124 }; 120 125 module_i2c_driver(bcm590xx_i2c_driver);