In the spi_alloc_device(), the parent pointer of spi deivce has been changed from master->dev.parent to &master->dev for device unregistration, so the pointer of getting the platform data as this 'spi->dev.parent->platform_data' is wrong.
Signed-off-by: Jiucheng Xu <jiucheng...@freescale.com> --- drivers/spi/spi-fsl-spi.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 6a62934..27059a6 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -143,7 +143,7 @@ static void fsl_spi_chipselect(struct spi_device *spi, int value) bool pol = spi->mode & SPI_CS_HIGH; struct spi_mpc8xxx_cs *cs = spi->controller_state; - pdata = spi->dev.parent->parent->platform_data; + pdata = mpc8xxx_spi->dev->platform_data; if (value == BITBANG_CS_INACTIVE) { if (pdata->cs_control) @@ -933,7 +933,8 @@ err: static void fsl_spi_cs_control(struct spi_device *spi, bool on) { - struct device *dev = spi->dev.parent->parent; + struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); + struct device *dev = mpc8xxx_spi->dev; struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data); u16 cs = spi->chip_select; int gpio = pinfo->gpios[cs]; -- 1.6.4 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general