summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/raw/nand_legacy.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-29 14:13:12 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-06-26 09:35:06 +0300
commite0160cd41fb81fde9ee4612a7ea2dfd631de2638 (patch)
tree2969b088000602d771707dbf4d55c5f52c082a8a /drivers/mtd/nand/raw/nand_legacy.c
parentd1bfe1e31932822ee90fc6b4cdeae785f70b3650 (diff)
downloadlinux-e0160cd41fb81fde9ee4612a7ea2dfd631de2638.tar.xz
mtd: rawnand: Hide the chip->data_interface indirection
As a preparation for allocating the data interface structure dynamically (and rename it), let's avoid accessing chip->data_interface directly. Instead, we introduce a helper, nand_get_interface_config(), and use it to retrieve the current data interface configuration out of a nand_chip object. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200529111322.7184-19-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/nand_legacy.c')
-rw-r--r--drivers/mtd/nand/raw/nand_legacy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/nand_legacy.c b/drivers/mtd/nand/raw/nand_legacy.c
index 848403dcae03..fe769762e1d8 100644
--- a/drivers/mtd/nand/raw/nand_legacy.c
+++ b/drivers/mtd/nand/raw/nand_legacy.c
@@ -354,6 +354,9 @@ static void nand_command(struct nand_chip *chip, unsigned int command,
static void nand_ccs_delay(struct nand_chip *chip)
{
+ const struct nand_sdr_timings *sdr =
+ nand_get_sdr_timings(nand_get_interface_config(chip));
+
/*
* The controller already takes care of waiting for tCCS when the RNDIN
* or RNDOUT command is sent, return directly.
@@ -366,7 +369,7 @@ static void nand_ccs_delay(struct nand_chip *chip)
* (which should be safe for all NANDs).
*/
if (nand_controller_can_setup_data_iface(chip))
- ndelay(chip->data_interface.timings.sdr.tCCS_min / 1000);
+ ndelay(sdr->tCCS_min / 1000);
else
ndelay(500);
}