Commit f9932c6e66c17ca3d84a7c6424c844bea8003ffb
Committed by
Lee Jones
1 parent
3698283b10
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>
Showing 1 changed file with 3 additions and 10 deletions Side-by-side Diff
drivers/mfd/act8945a.c
... | ... | @@ -46,8 +46,9 @@ |
46 | 46 | |
47 | 47 | i2c_set_clientdata(i2c, regmap); |
48 | 48 | |
49 | - ret = mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, act8945a_devs, | |
50 | - ARRAY_SIZE(act8945a_devs), NULL, 0, NULL); | |
49 | + ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE, | |
50 | + act8945a_devs, ARRAY_SIZE(act8945a_devs), | |
51 | + NULL, 0, NULL); | |
51 | 52 | if (ret) { |
52 | 53 | dev_err(&i2c->dev, "Failed to add sub devices\n"); |
53 | 54 | return ret; |
... | ... | @@ -56,13 +57,6 @@ |
56 | 57 | return 0; |
57 | 58 | } |
58 | 59 | |
59 | -static int act8945a_i2c_remove(struct i2c_client *i2c) | |
60 | -{ | |
61 | - mfd_remove_devices(&i2c->dev); | |
62 | - | |
63 | - return 0; | |
64 | -} | |
65 | - | |
66 | 60 | static const struct i2c_device_id act8945a_i2c_id[] = { |
67 | 61 | { "act8945a", 0 }, |
68 | 62 | {} |
... | ... | @@ -81,7 +75,6 @@ |
81 | 75 | .of_match_table = of_match_ptr(act8945a_of_match), |
82 | 76 | }, |
83 | 77 | .probe = act8945a_i2c_probe, |
84 | - .remove = act8945a_i2c_remove, | |
85 | 78 | .id_table = act8945a_i2c_id, |
86 | 79 | }; |
87 | 80 |