diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-10-29 15:26:37 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-11-06 14:08:10 +0100 |
commit | 5f605dc6168c2508e44ce81c7b169095849488ea (patch) | |
tree | 58339e4c36848213e0998b9903d676f7c4887d60 /drivers/mtd/nand/nand_orion.c | |
parent | 068d7560c79f79674faf0267a319e4dc9b9bce8f (diff) | |
download | barebox-5f605dc6168c2508e44ce81c7b169095849488ea.tar.gz barebox-5f605dc6168c2508e44ce81c7b169095849488ea.tar.xz |
mtd: nand: Pass struct nand_chip around
Traditionally Linux passed a struct mtd_info * around as context
between the different functions. This has been changed to a struct
nand_chip *. Do the same for barebox as well as another step towards
updating the NAND layer to current Linux.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_orion.c')
-rw-r--r-- | drivers/mtd/nand/nand_orion.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mtd/nand/nand_orion.c b/drivers/mtd/nand/nand_orion.c index c8b89cd03c..ac1c8442c0 100644 --- a/drivers/mtd/nand/nand_orion.c +++ b/drivers/mtd/nand/nand_orion.c @@ -27,9 +27,8 @@ struct orion_nand { u8 cle; /* address line number connected to CLE */ }; -static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) +static void orion_nand_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl) { - struct nand_chip *chip = mtd_to_nand(mtd); struct orion_nand *priv = chip->priv; u32 offs; @@ -49,9 +48,8 @@ static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl writeb(cmd, chip->IO_ADDR_W + offs); } -static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) +static void orion_nand_read_buf(struct nand_chip *chip, uint8_t *buf, int len) { - struct nand_chip *chip = mtd_to_nand(mtd); void __iomem *io_base = chip->IO_ADDR_R; uint64_t *buf64; int i = 0; @@ -132,12 +130,12 @@ static int orion_nand_probe(struct device_d *dev) if (!IS_ERR(clk)) clk_enable(clk); - if (nand_scan(mtd, 1)) { + if (nand_scan(chip, 1)) { ret = -ENXIO; goto no_dev; } - add_mtd_nand_device(mtd, "orion_nand"); + add_mtd_nand_device(chip, "orion_nand"); return 0; no_dev: if (!IS_ERR(clk)) |