]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/of/platform.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[karo-tx-linux.git] / drivers / of / platform.c
index eeca8a5969731bc397d9aa0f4fdc804470addd2d..9b439ac63d8e73eef85aa490d5cab6ec825120b7 100644 (file)
@@ -197,7 +197,7 @@ EXPORT_SYMBOL(of_device_alloc);
  * Returns pointer to created platform device, or NULL if a device was not
  * registered.  Unavailable devices will not get registered.
  */
-struct platform_device *of_platform_device_create_pdata(
+static struct platform_device *of_platform_device_create_pdata(
                                        struct device_node *np,
                                        const char *bus_id,
                                        void *platform_data,
@@ -268,8 +268,11 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
                return NULL;
 
        dev = amba_device_alloc(NULL, 0, 0);
-       if (!dev)
+       if (!dev) {
+               pr_err("%s(): amba_device_alloc() failed for %s\n",
+                      __func__, node->full_name);
                return NULL;
+       }
 
        /* setup generic device info */
        dev->dev.coherent_dma_mask = ~0;
@@ -294,12 +297,18 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
                dev->irq[i] = irq_of_parse_and_map(node, i);
 
        ret = of_address_to_resource(node, 0, &dev->res);
-       if (ret)
+       if (ret) {
+               pr_err("%s(): of_address_to_resource() failed (%d) for %s\n",
+                      __func__, ret, node->full_name);
                goto err_free;
+       }
 
        ret = amba_device_add(dev, &iomem_resource);
-       if (ret)
+       if (ret) {
+               pr_err("%s(): amba_device_add() failed (%d) for %s\n",
+                      __func__, ret, node->full_name);
                goto err_free;
+       }
 
        return dev;
 
@@ -378,6 +387,10 @@ static int of_platform_bus_create(struct device_node *bus,
        }
 
        if (of_device_is_compatible(bus, "arm,primecell")) {
+               /*
+                * Don't return an error here to keep compatibility with older
+                * device tree files.
+                */
                of_amba_device_create(bus, bus_id, platform_data, parent);
                return 0;
        }