This is needed when creating pci-amba devices: an amba device's
resource shall be child of the corresponding pci device's resource.

Signed-off-by: Davide Ciminaghi <cimina...@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asna...@st.com>
---
 drivers/of/platform.c       |   11 +++++++----
 include/linux/of_platform.h |    3 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 57c6bbe..bf75aaa 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -252,7 +252,8 @@ EXPORT_SYMBOL(of_platform_device_create);
 struct amba_device *of_amba_device_create(struct device_node *node,
                                          const char *bus_id,
                                          void *platform_data,
-                                         struct device *parent)
+                                         struct device *parent,
+                                         struct resource *parent_resource)
 {
        struct amba_device *dev;
        const void *prop;
@@ -293,7 +294,7 @@ struct amba_device *of_amba_device_create(struct 
device_node *node,
        if (ret)
                goto err_free;
 
-       ret = amba_device_add(dev, &iomem_resource);
+       ret = amba_device_add(dev, parent_resource);
        if (ret)
                goto err_free;
 
@@ -307,7 +308,8 @@ err_free:
 struct amba_device *of_amba_device_create(struct device_node *node,
                                          const char *bus_id,
                                          void *platform_data,
-                                         struct device *parent)
+                                         struct device *parent,
+                                         struct resource *parent_resource)
 {
        return NULL;
 }
@@ -375,7 +377,8 @@ static int of_platform_bus_create(struct device_node *bus,
        }
 
        if (of_device_is_compatible(bus, "arm,primecell")) {
-               of_amba_device_create(bus, bus_id, platform_data, parent);
+               of_amba_device_create(bus, bus_id, platform_data, parent,
+                                     &iomem_resource);
                return 0;
        }
 
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 6cd5ac2..be13538 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -66,7 +66,8 @@ extern struct platform_device 
*of_platform_device_create(struct device_node *np,
 extern struct amba_device *of_amba_device_create(struct device_node *node,
                                                 const char *bus_id,
                                                 void *platform_data,
-                                                struct device *parent);
+                                                struct device *parent,
+                                                struct resource *parent_res);
 
 extern int of_platform_bus_probe(struct device_node *root,
                                 const struct of_device_id *matches,
-- 
1.7.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to