summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris BREZILLON2015-12-10 09:00:38 +0100
committerBrian Norris2015-12-18 22:22:53 +0100
commit29574ede097438c560e8115caff9b6b8668730be (patch)
tree922bb95007d79d281134a0d8d95a085d465f4b99
parentmtd: nand: simplify nand_dt_init() usage (diff)
downloadkernel-qcow2-linux-29574ede097438c560e8115caff9b6b8668730be.tar.gz
kernel-qcow2-linux-29574ede097438c560e8115caff9b6b8668730be.tar.xz
kernel-qcow2-linux-29574ede097438c560e8115caff9b6b8668730be.zip
mtd: nand: kill the chip->flash_node field
Now that the nand_chip struct directly embeds an mtd_info struct we can get rid of the ->flash_node field and forward set/get_flash_node requests to the MTD layer. As a side effect, we no longer need the mtd_set_of_node() call done in nand_dt_init(). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/nand/nand_base.c3
-rw-r--r--include/linux/mtd/nand.h7
2 files changed, 2 insertions, 8 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ae3fd2a8c2f5..8bb8ebd62aaa 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3945,9 +3945,6 @@ static int nand_dt_init(struct nand_chip *chip)
if (!dn)
return 0;
- /* MTD can automatically handle DT partitions, etc. */
- mtd_set_of_node(nand_to_mtd(chip), dn);
-
if (of_get_nand_bus_width(dn) == 16)
chip->options |= NAND_BUSWIDTH_16;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9cb7ace6fb1f..2bee2e42ae2f 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -545,7 +545,6 @@ struct nand_buffers {
* flash device
* @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the
* flash device.
- * @flash_node: [BOARDSPECIFIC] device node describing this instance
* @read_byte: [REPLACEABLE] read one byte from the chip
* @read_word: [REPLACEABLE] read one word from the chip
* @write_byte: [REPLACEABLE] write a single byte to the chip on the
@@ -645,8 +644,6 @@ struct nand_chip {
void __iomem *IO_ADDR_R;
void __iomem *IO_ADDR_W;
- struct device_node *flash_node;
-
uint8_t (*read_byte)(struct mtd_info *mtd);
u16 (*read_word)(struct mtd_info *mtd);
void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
@@ -724,12 +721,12 @@ struct nand_chip {
static inline void nand_set_flash_node(struct nand_chip *chip,
struct device_node *np)
{
- chip->flash_node = np;
+ mtd_set_of_node(&chip->mtd, np);
}
static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
{
- return chip->flash_node;
+ return mtd_get_of_node(&chip->mtd);
}
static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)