linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_dev - Use devm_mfd_add_devices
@ 2017-08-07 11:18 Jeffy Chen
  2017-08-15  6:47 ` Benson Leung
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffy Chen @ 2017-08-07 11:18 UTC (permalink / raw)
  To: bleung; +Cc: Jeffy Chen, Olof Johansson, linux-kernel

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 #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>
---

 drivers/platform/chrome/cros_ec_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_dev.c b/drivers/platform/chrome/cros_ec_dev.c
index cf6c4f0..349ea60 100644
--- a/drivers/platform/chrome/cros_ec_dev.c
+++ b/drivers/platform/chrome/cros_ec_dev.c
@@ -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");
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_dev - Use devm_mfd_add_devices
  2017-08-07 11:18 [PATCH] platform/chrome: cros_ec_dev - Use devm_mfd_add_devices Jeffy Chen
@ 2017-08-15  6:47 ` Benson Leung
  0 siblings, 0 replies; 2+ messages in thread
From: Benson Leung @ 2017-08-15  6:47 UTC (permalink / raw)
  To: Jeffy Chen; +Cc: bleung, Olof Johansson, linux-kernel, bleung

[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]

Hi Jeffy,

On Mon, Aug 07, 2017 at 07:18:54PM +0800, Jeffy Chen wrote:
> 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 #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>

Thanks for the fix. Applied for v4.14.

Thanks,
Benson

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-15  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 11:18 [PATCH] platform/chrome: cros_ec_dev - Use devm_mfd_add_devices Jeffy Chen
2017-08-15  6:47 ` Benson Leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).