aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-19 10:40:00 -0700
committerSimon Glass <sjg@chromium.org>2021-01-05 12:24:41 -0700
commite2a7cfe9d5fce65789972a31ff50fb1d8d509848 (patch)
tree085b2ec36757a215d7f9ed647af5a5c6aa09f149 /include/linux/mtd/nand.h
parenta53f6fad7ea20f6ccde21f68e3b44ab7fe8bf6cd (diff)
downloadu-boot-e2a7cfe9d5fce65789972a31ff50fb1d8d509848.zip
u-boot-e2a7cfe9d5fce65789972a31ff50fb1d8d509848.tar.gz
u-boot-e2a7cfe9d5fce65789972a31ff50fb1d8d509848.tar.bz2
spi: Tidy up get/set of device node
This code is a bit odd in that it only reads and updates the livetree version of the device ofnode. This means it won't work with flattree. Update the code to work as it was presumably intended. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 13e8dd1..7774c17 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -389,6 +389,7 @@ static inline int nanddev_unregister(struct nand_device *nand)
return mtd_device_unregister(nand->mtd);
}
+#ifndef __UBOOT__
/**
* nanddev_set_of_node() - Attach a DT node to a NAND device
* @nand: NAND device
@@ -412,6 +413,19 @@ static inline const struct device_node *nanddev_get_of_node(struct nand_device *
{
return mtd_get_of_node(nand->mtd);
}
+#else
+/**
+ * nanddev_set_of_node() - Attach a DT node to a NAND device
+ * @nand: NAND device
+ * @node: ofnode
+ *
+ * Attach a DT node to a NAND device.
+ */
+static inline void nanddev_set_ofnode(struct nand_device *nand, ofnode node)
+{
+ mtd_set_ofnode(nand->mtd, node);
+}
+#endif /* __UBOOT__ */
/**
* nanddev_offs_to_pos() - Convert an absolute NAND offset into a NAND position