aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-04-07 14:42:57 -0400
committerLee Jones <lee.jones@linaro.org>2016-04-19 02:54:40 -0400
commitf9932c6e66c17ca3d84a7c6424c844bea8003ffb (patch)
treecbc87b145f731e7bd8b5a351f517757049b505cb
parent3698283b101388cb9d992ae4d34329f005aa35e8 (diff)
mfd: act8945a: 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: Wenyou Yang <wenyou.yang@atmel.com> CC: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/act8945a.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/mfd/act8945a.c b/drivers/mfd/act8945a.c
index 525b546ba42f..10c6d2da8822 100644
--- a/drivers/mfd/act8945a.c
+++ b/drivers/mfd/act8945a.c
@@ -46,8 +46,9 @@ static int act8945a_i2c_probe(struct i2c_client *i2c,
46 46
47 i2c_set_clientdata(i2c, regmap); 47 i2c_set_clientdata(i2c, regmap);
48 48
49 ret = mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, act8945a_devs, 49 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE,
50 ARRAY_SIZE(act8945a_devs), NULL, 0, NULL); 50 act8945a_devs, ARRAY_SIZE(act8945a_devs),
51 NULL, 0, NULL);
51 if (ret) { 52 if (ret) {
52 dev_err(&i2c->dev, "Failed to add sub devices\n"); 53 dev_err(&i2c->dev, "Failed to add sub devices\n");
53 return ret; 54 return ret;
@@ -56,13 +57,6 @@ static int act8945a_i2c_probe(struct i2c_client *i2c,
56 return 0; 57 return 0;
57} 58}
58 59
59static int act8945a_i2c_remove(struct i2c_client *i2c)
60{
61 mfd_remove_devices(&i2c->dev);
62
63 return 0;
64}
65
66static const struct i2c_device_id act8945a_i2c_id[] = { 60static const struct i2c_device_id act8945a_i2c_id[] = {
67 { "act8945a", 0 }, 61 { "act8945a", 0 },
68 {} 62 {}
@@ -81,7 +75,6 @@ static struct i2c_driver act8945a_i2c_driver = {
81 .of_match_table = of_match_ptr(act8945a_of_match), 75 .of_match_table = of_match_ptr(act8945a_of_match),
82 }, 76 },
83 .probe = act8945a_i2c_probe, 77 .probe = act8945a_i2c_probe,
84 .remove = act8945a_i2c_remove,
85 .id_table = act8945a_i2c_id, 78 .id_table = act8945a_i2c_id,
86}; 79};
87 80