aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-fsl-spi.c')
-rw-r--r--drivers/spi/spi-fsl-spi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 24cacff57786..5f748c0d96bd 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -139,10 +139,12 @@ static void fsl_spi_change_mode(struct spi_device *spi)
139static void fsl_spi_chipselect(struct spi_device *spi, int value) 139static void fsl_spi_chipselect(struct spi_device *spi, int value)
140{ 140{
141 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); 141 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
142 struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data; 142 struct fsl_spi_platform_data *pdata;
143 bool pol = spi->mode & SPI_CS_HIGH; 143 bool pol = spi->mode & SPI_CS_HIGH;
144 struct spi_mpc8xxx_cs *cs = spi->controller_state; 144 struct spi_mpc8xxx_cs *cs = spi->controller_state;
145 145
146 pdata = spi->dev.parent->parent->platform_data;
147
146 if (value == BITBANG_CS_INACTIVE) { 148 if (value == BITBANG_CS_INACTIVE) {
147 if (pdata->cs_control) 149 if (pdata->cs_control)
148 pdata->cs_control(spi, !pol); 150 pdata->cs_control(spi, !pol);