]> Pileus Git - ~andy/linux/blobdiff - drivers/of/platform.c
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
[~andy/linux] / drivers / of / platform.c
index f6dcde22082155577b3cdf0b0f55f103e059cae6..9b439ac63d8e73eef85aa490d5cab6ec825120b7 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/of_device.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
 
 const struct of_device_id of_default_bus_match_table[] = {
@@ -218,6 +219,8 @@ static struct platform_device *of_platform_device_create_pdata(
        dev->dev.bus = &platform_bus_type;
        dev->dev.platform_data = platform_data;
 
+       of_reserved_mem_device_init(&dev->dev);
+
        /* We do not fill the DMA ops for platform devices by default.
         * This is currently the responsibility of the platform code
         * to do such, possibly using a device notifier
@@ -225,6 +228,7 @@ static struct platform_device *of_platform_device_create_pdata(
 
        if (of_device_add(dev) != 0) {
                platform_device_put(dev);
+               of_reserved_mem_device_release(&dev->dev);
                return NULL;
        }