diff options
author | Mark Brown <broonie@kernel.org> | 2015-02-07 22:16:38 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-07 22:16:38 -0500 |
commit | d202c30690e06a96ab788970897a8cf7f3325118 (patch) | |
tree | 5fb25f28f792c523d9212dd1111642831b17f5f3 | |
parent | e36f014edff70fc02b3d3d79cead1d58f289332e (diff) | |
parent | d426a842b0c203c182ec2658efc4282ef1eb80be (diff) |
Merge tag 'spi-v3.19-rc7' into spi-linus
spi: Fixes for v3.19
A couple of driver specific fixes:
- Disable DMA mode for i.MX6DL chips due to a hardware bug.
- Don't use devm_kzalloc() outside of bind/unbind paths in the fsl-dspi
driver, fixing memory leaks.
# gpg: Signature made Thu 05 Feb 2015 05:06:57 HKT using RSA key ID 5D5487D0
# gpg: WARNING: digest algorithm MD5 is deprecated
# gpg: please see http://www.gnupg.org/faq/weak-digest-algos.html for more information
# gpg: Oops: keyid_from_fingerprint: no pubkey
# gpg: key AF88CD16: no public key for trusted key - skipped
# gpg: key AF88CD16 marked as ultimately trusted
# gpg: key 5621E907: no public key for trusted key - skipped
# gpg: key 5621E907 marked as ultimately trusted
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg: aka "Mark Brown <broonie@debian.org>"
# gpg: aka "Mark Brown <broonie@kernel.org>"
# gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg: aka "Mark Brown <broonie@linaro.org>"
# gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 14 | ||||
-rw-r--r-- | drivers/spi/spi-imx.c | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 4cda994d3f40..9b80d54d4ddb 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c | |||
@@ -342,8 +342,7 @@ static int dspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) | |||
342 | /* Only alloc on first setup */ | 342 | /* Only alloc on first setup */ |
343 | chip = spi_get_ctldata(spi); | 343 | chip = spi_get_ctldata(spi); |
344 | if (chip == NULL) { | 344 | if (chip == NULL) { |
345 | chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data), | 345 | chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); |
346 | GFP_KERNEL); | ||
347 | if (!chip) | 346 | if (!chip) |
348 | return -ENOMEM; | 347 | return -ENOMEM; |
349 | } | 348 | } |
@@ -382,6 +381,16 @@ static int dspi_setup(struct spi_device *spi) | |||
382 | return dspi_setup_transfer(spi, NULL); | 381 | return dspi_setup_transfer(spi, NULL); |
383 | } | 382 | } |
384 | 383 | ||
384 | static void dspi_cleanup(struct spi_device *spi) | ||
385 | { | ||
386 | struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi); | ||
387 | |||
388 | dev_dbg(&spi->dev, "spi_device %u.%u cleanup\n", | ||
389 | spi->master->bus_num, spi->chip_select); | ||
390 | |||
391 | kfree(chip); | ||
392 | } | ||
393 | |||
385 | static irqreturn_t dspi_interrupt(int irq, void *dev_id) | 394 | static irqreturn_t dspi_interrupt(int irq, void *dev_id) |
386 | { | 395 | { |
387 | struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id; | 396 | struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id; |
@@ -467,6 +476,7 @@ static int dspi_probe(struct platform_device *pdev) | |||
467 | dspi->bitbang.master->setup = dspi_setup; | 476 | dspi->bitbang.master->setup = dspi_setup; |
468 | dspi->bitbang.master->dev.of_node = pdev->dev.of_node; | 477 | dspi->bitbang.master->dev.of_node = pdev->dev.of_node; |
469 | 478 | ||
479 | master->cleanup = dspi_cleanup; | ||
470 | master->mode_bits = SPI_CPOL | SPI_CPHA; | 480 | master->mode_bits = SPI_CPOL | SPI_CPHA; |
471 | master->bits_per_word_mask = SPI_BPW_MASK(4) | SPI_BPW_MASK(8) | | 481 | master->bits_per_word_mask = SPI_BPW_MASK(4) | SPI_BPW_MASK(8) | |
472 | SPI_BPW_MASK(16); | 482 | SPI_BPW_MASK(16); |
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 961b97d43b43..fe1b7699fab6 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c | |||
@@ -823,6 +823,10 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, | |||
823 | struct dma_slave_config slave_config = {}; | 823 | struct dma_slave_config slave_config = {}; |
824 | int ret; | 824 | int ret; |
825 | 825 | ||
826 | /* use pio mode for i.mx6dl chip TKT238285 */ | ||
827 | if (of_machine_is_compatible("fsl,imx6dl")) | ||
828 | return 0; | ||
829 | |||
826 | /* Prepare for TX DMA: */ | 830 | /* Prepare for TX DMA: */ |
827 | master->dma_tx = dma_request_slave_channel(dev, "tx"); | 831 | master->dma_tx = dma_request_slave_channel(dev, "tx"); |
828 | if (!master->dma_tx) { | 832 | if (!master->dma_tx) { |