diff options
Diffstat (limited to 'drivers/spi/spi-davinci.c')
-rw-r--r-- | drivers/spi/spi-davinci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 50b13c9b1ab6..222d3e37fc28 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c | |||
@@ -299,16 +299,15 @@ static int davinci_spi_setup_transfer(struct spi_device *spi, | |||
299 | * Assign function pointer to appropriate transfer method | 299 | * Assign function pointer to appropriate transfer method |
300 | * 8bit, 16bit or 32bit transfer | 300 | * 8bit, 16bit or 32bit transfer |
301 | */ | 301 | */ |
302 | if (bits_per_word <= 8 && bits_per_word >= 2) { | 302 | if (bits_per_word <= 8) { |
303 | dspi->get_rx = davinci_spi_rx_buf_u8; | 303 | dspi->get_rx = davinci_spi_rx_buf_u8; |
304 | dspi->get_tx = davinci_spi_tx_buf_u8; | 304 | dspi->get_tx = davinci_spi_tx_buf_u8; |
305 | dspi->bytes_per_word[spi->chip_select] = 1; | 305 | dspi->bytes_per_word[spi->chip_select] = 1; |
306 | } else if (bits_per_word <= 16 && bits_per_word >= 2) { | 306 | } else { |
307 | dspi->get_rx = davinci_spi_rx_buf_u16; | 307 | dspi->get_rx = davinci_spi_rx_buf_u16; |
308 | dspi->get_tx = davinci_spi_tx_buf_u16; | 308 | dspi->get_tx = davinci_spi_tx_buf_u16; |
309 | dspi->bytes_per_word[spi->chip_select] = 2; | 309 | dspi->bytes_per_word[spi->chip_select] = 2; |
310 | } else | 310 | } |
311 | return -EINVAL; | ||
312 | 311 | ||
313 | if (!hz) | 312 | if (!hz) |
314 | hz = spi->max_speed_hz; | 313 | hz = spi->max_speed_hz; |
@@ -865,7 +864,7 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
865 | goto err; | 864 | goto err; |
866 | } | 865 | } |
867 | 866 | ||
868 | dev_set_drvdata(&pdev->dev, master); | 867 | platform_set_drvdata(pdev, master); |
869 | 868 | ||
870 | dspi = spi_master_get_devdata(master); | 869 | dspi = spi_master_get_devdata(master); |
871 | if (dspi == NULL) { | 870 | if (dspi == NULL) { |
@@ -933,6 +932,7 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
933 | master->dev.of_node = pdev->dev.of_node; | 932 | master->dev.of_node = pdev->dev.of_node; |
934 | master->bus_num = pdev->id; | 933 | master->bus_num = pdev->id; |
935 | master->num_chipselect = pdata->num_chipselect; | 934 | master->num_chipselect = pdata->num_chipselect; |
935 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); | ||
936 | master->setup = davinci_spi_setup; | 936 | master->setup = davinci_spi_setup; |
937 | 937 | ||
938 | dspi->bitbang.chipselect = davinci_spi_chipselect; | 938 | dspi->bitbang.chipselect = davinci_spi_chipselect; |
@@ -1044,7 +1044,7 @@ static int davinci_spi_remove(struct platform_device *pdev) | |||
1044 | struct spi_master *master; | 1044 | struct spi_master *master; |
1045 | struct resource *r; | 1045 | struct resource *r; |
1046 | 1046 | ||
1047 | master = dev_get_drvdata(&pdev->dev); | 1047 | master = platform_get_drvdata(pdev); |
1048 | dspi = spi_master_get_devdata(master); | 1048 | dspi = spi_master_get_devdata(master); |
1049 | 1049 | ||
1050 | spi_bitbang_stop(&dspi->bitbang); | 1050 | spi_bitbang_stop(&dspi->bitbang); |