mfd: cros_ec: Use devm_of_platform_populate()
Use devm_of_platform_populate() to be sure that of_platform_depopulate is called when removing the driver. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
ad56b2a4da
commit
2eb131efb1
@ -147,7 +147,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
|
||||
err = of_platform_populate(dev->of_node, NULL, NULL, dev);
|
||||
err = devm_of_platform_populate(dev);
|
||||
if (err) {
|
||||
mfd_remove_devices(dev);
|
||||
dev_err(dev, "Failed to register sub-devices\n");
|
||||
|
Loading…
Reference in New Issue
Block a user