Thread (13 messages) flat view 13 messages, 6 authors, 2012-07-12

Re: [PATCH V3 5/6] Avoid duplicate probe for of platform devices

From: Greg KH <hidden>
Date: 2012-07-06 04:26:14
Also in: lkml

On Fri, Jul 06, 2012 at 02:05:05AM +0000, Jia Hongtao-B38951 wrote:
Hi Rob and Greg KH,

Do you have any better idea to avoid duplication probe warning?
I have no idea what the problem is that you are trying to solve.
quoted
On 06/08/2012 04:43 AM, Jia Hongtao wrote:
quoted
We changed the pcie controller driver to platform driver so that the
PCI
quoted
of platform devices need to be created earlier in the arch_initcall
stage
quoted
according to the original timing of calling fsl_add_bridge(). So we do
PCI
quoted
probing separately from other devices. But probing more than once could
cause duplication warning. We add check if the devices have already
probed
quoted
before probing any devices to avoid duplication warning.
Ick, something else is going wrong here, how could you ever have the
same device probed more than once?
quoted
quoted
Signed-off-by: Jia Hongtao <redacted>
Signed-off-by: Li Yang <redacted>
---
Where's v1 and v2 history?
quoted
 drivers/of/platform.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index a37330e..3aab01f 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -139,6 +139,18 @@ struct platform_device *of_device_alloc(struct
device_node *np,
quoted
 	if (!dev)
 		return NULL;

+	dev->dev.of_node = of_node_get(np);
+	if (bus_id)
+		dev_set_name(&dev->dev, "%s", bus_id);
+	else
+		of_device_make_bus_id(&dev->dev);
+
+	if (kset_find_obj(dev->dev.kobj.kset, kobject_name(&dev->dev.kobj)))
Whatever you are trying to do here, odds are, it's wrong :)

What is happening that is causing the problem?  What is causing the
platform core to be calling probe on a device more than once?

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help