* Author: Dipen Dudhat <Dipen.Dudhat@freescale.com>
*/
+#include <linux/cleanup.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/types.h>
/* Fill in fsl_ifc_mtd structure */
mtd->dev.parent = priv->dev;
- nand_set_flash_node(chip, priv->dev->of_node);
+
+ struct device_node *np __free(device_node) =
+ of_get_next_child_with_prefix(priv->dev->of_node, NULL, "nand");
+
+ if (np)
+ nand_set_flash_node(chip, np);
+ else
+ nand_set_flash_node(chip, priv->dev->of_node);
/* fill in nand_chip structure */
/* set up function call table */