diff options
author | Huang Shijie <b32955@freescale.com> | 2014-04-24 17:53:52 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:02:32 -0600 |
commit | e231d0400a1d8cbfcb7a974d897d32ce0112848c (patch) | |
tree | c77b8443cea03a3da9e9c67c2f04791bbf6e2182 /drivers | |
parent | 516db20f24938aa5482334d2726d70e9935ed32b (diff) |
ENGR00318895-3 mtd: spi-nor: add a new field for spi_nor{}
We need the SPI NOR child node to store some specific features, such as the
dummy cycles for the DDR Quad read.
But now, we only have the @dev field in the spi_nor{}. The @dev may points to a
spi_device{} for m25p80, while it may points to a platform_deivice{} for the
SPI NOR controller, such as fsl_quadspi.c.
It is not convenient for us to get come information from the SPI NOR flash.
This patch adds a new field @np to spi_nor{}, it points to the child node for
the SPI NOR flash.
Signed-off-by: Huang Shijie <b32955@freescale.com>
(cherry picked from commit 9b4c87e0756093a04eb0948396928c8adbd1ee08)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 1 | ||||
-rw-r--r-- | drivers/mtd/spi-nor/spi-nor.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 3af137f49ac9..318ff8d9706d 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -201,6 +201,7 @@ static int m25p_probe(struct spi_device *spi) nor->read_reg = m25p80_read_reg; nor->dev = &spi->dev; + nor->np = spi->dev.of_node; nor->mtd = &flash->mtd; nor->priv = flash; diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 14a5d2325dac..4efe7e84bf57 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -3,7 +3,7 @@ * influence from lart.c (Abraham Van Der Merwe) and mtd_dataflash.c * * Copyright (C) 2005, Intec Automation Inc. - * Copyright (C) 2014, Freescale Semiconductor, Inc. + * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -995,7 +995,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) struct flash_info *info; struct device *dev = nor->dev; struct mtd_info *mtd = nor->mtd; - struct device_node *np = dev->of_node; + struct device_node *np = nor->np; int ret; int i; |