Skip to content

Commit

Permalink
platform/chrome: cros_ec_dev - Use devm_mfd_add_devices
Browse files Browse the repository at this point in the history
Currently we are calling mfd_add_devices to add devices without matched
mfd_remove_devices to remove them.

That would cause warning when re-binding cros_ec_dev:

[  123.536192] sysfs: cannot create duplicate filename '/bus/platform/devices/cros-
ec-accel.0'
[  123.536210] ------------[ cut here ]------------
[  123.536223] WARNING: CPU: 3 PID: 156 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x
84
[  123.536226] Modules linked in:
[  123.536236] CPU: 3 PID: 156 Comm: bash Not tainted 4.13.0-rc3-next-20170731 torvalds#216
[  123.536238] Hardware name: Google Kevin (DT)
[  123.536242] task: ffffffc0f28bab80 task.stack: ffffffc0f1b30000
[  123.536247] PC is at sysfs_warn_dup+0x68/0x84
[  123.536251] LR is at sysfs_warn_dup+0x68/0x84

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
  • Loading branch information
JeffyCN authored and bleungatchromium committed Aug 11, 2017
1 parent aae4e7a commit bf3d740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/platform/chrome/cros_ec_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec)
id++;
}

ret = mfd_add_devices(ec->dev, 0, sensor_cells, id,
NULL, 0, NULL);
ret = devm_mfd_add_devices(ec->dev, 0, sensor_cells, id,
NULL, 0, NULL);
if (ret)
dev_err(ec->dev, "failed to add EC sensors\n");

Expand Down

0 comments on commit bf3d740

Please sign in to comment.