For fsl_qspi_claim_bus and fsl_qspi_release_bus, the input parameter "struct udevice *dev" represents device: "qspi[x]: qspi@[address] {...}". Since "dev" already represents the qspi controller, use its parent to get platdata and get 'priv' is wrong.
After applying this patch, qspi flashes can be correctly probed. CC: Simon Glass <s...@chromium.org> CC: Jagannadha Sutradharudu Teki <jagannadh.t...@gmail.com> CC: Haikun Wang <haikun.w...@freescale.com> Signed-off-by: Peng Fan <peng....@freescale.com> --- Hi, This patch is based on dm/next branch. Regards, Peng. drivers/spi/fsl_qspi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index 868df5f..04f1801 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -1044,11 +1044,9 @@ static int fsl_qspi_xfer(struct udevice *dev, unsigned int bitlen, static int fsl_qspi_claim_bus(struct udevice *dev) { struct fsl_qspi_priv *priv; - struct udevice *bus; - struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); + struct dm_spi_slave_platdata *slave_plat = dev_get_platdata(dev); - bus = dev->parent; - priv = dev_get_priv(bus); + priv = dev_get_priv(dev); priv->cur_amba_base = priv->amba_base[0] + FSL_QSPI_FLASH_SIZE * slave_plat->cs; @@ -1061,10 +1059,8 @@ static int fsl_qspi_claim_bus(struct udevice *dev) static int fsl_qspi_release_bus(struct udevice *dev) { struct fsl_qspi_priv *priv; - struct udevice *bus; - bus = dev->parent; - priv = dev_get_priv(bus); + priv = dev_get_priv(dev); qspi_module_disable(priv, 1); -- 1.8.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot