linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] mfd: Fix runtime warning caused by duplicate device registration
@ 2012-07-03 11:59 Lee Jones
  2012-07-03 12:35 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Lee Jones @ 2012-07-03 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

We register the ab8500 as an MFD device from db8500 code during Device Tree
boot in order to solve some limitations of DT. However, when Device Tree is
not enabled, we still want to allow platform code to register the ab8500 in
the normal way. Here we force MFD device registration of the ab8500 only
when booting with Device Tree enabled.

Solves this issue:
WARNING: at fs/sysfs/dir.c:526 sysfs_add_one+0x88/0xb0()
sysfs: cannot create duplicate filename '/bus/platform/devices/ab8500-core.0'

Reported-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/db8500-prcmu.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 80def6c..4ec0ed1 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2964,6 +2964,9 @@ static struct mfd_cell db8500_prcmu_devs[] = {
 		.name = "cpufreq-u8500",
 		.of_compatible = "stericsson,cpufreq-u8500",
 	},
+};
+
+static struct mfd_cell db8500_of_prcmu_devs[] = {
 	{
 		.name = "ab8500-core",
 		.of_compatible = "stericsson,ab8500",
@@ -3014,6 +3017,15 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
 		return err;
 	}
 
+	if (np) {
+		err = mfd_add_devices(&pdev->dev, 0, db8500_of_prcmu_devs,
+				ARRAY_SIZE(db8500_of_prcmu_devs), NULL, 0);
+		if (err) {
+			pr_err("prcmu: Failed to add DT subdevices\n");
+			return err;
+		}
+	}
+
 	pr_info("DB8500 PRCMU initialized\n");
 
 no_irq_return:
-- 
1.7.9.5

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

end of thread, other threads:[~2012-07-05 15:51 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03 11:59 [PATCH 1/1] mfd: Fix runtime warning caused by duplicate device registration Lee Jones
2012-07-03 12:35 ` Mark Brown
2012-07-03 13:07   ` Lee Jones
2012-07-03 13:24     ` Mark Brown
2012-07-03 13:48       ` Lee Jones
2012-07-03 14:21         ` Mark Brown
2012-07-05  7:36           ` Lee Jones
2012-07-05  9:45             ` Mark Brown
2012-07-05 11:46               ` Lee Jones
2012-07-05 12:06                 ` Mark Brown
2012-07-05 12:15                   ` Lee Jones
2012-07-05 12:29                     ` Mark Brown
2012-07-05 12:41                       ` Lee Jones
2012-07-05 12:45                         ` Mark Brown
2012-07-05 12:55                           ` Lee Jones
2012-07-05 13:03                             ` Mark Brown
2012-07-05 13:12                               ` Lee Jones
2012-07-05 13:20                                 ` Mark Brown
2012-07-05 13:54                                   ` Lee Jones
2012-07-05 13:57                                     ` Mark Brown
2012-07-05 14:06                                 ` Samuel Ortiz
2012-07-05 13:57                           ` Arnd Bergmann
2012-07-05 14:04                             ` Mark Brown
2012-07-05 14:06                             ` Lee Jones
2012-07-05 14:13                               ` Mark Brown
2012-07-05 14:35                                 ` Lee Jones
2012-07-05 15:41                                   ` Arnd Bergmann
2012-07-05 15:51                                     ` Lee Jones
2012-07-03 14:01       ` Arnd Bergmann
2012-07-03 14:43         ` Mark Brown
2012-07-05  7:33 ` Lee Jones
2012-07-05 13:08 ` Fabio Estevam
2012-07-05 13:13   ` Lee Jones

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).