Skip to content

Commit

Permalink
Merge tag 'spi-v3.19-rc7' into spi-linus
Browse files Browse the repository at this point in the history
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>"
  • Loading branch information
Mark Brown committed Feb 8, 2015
2 parents e36f014 + d426a84 commit d202c30
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/spi/spi-fsl-dspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ static int dspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
/* Only alloc on first setup */
chip = spi_get_ctldata(spi);
if (chip == NULL) {
chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data),
GFP_KERNEL);
chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
if (!chip)
return -ENOMEM;
}
Expand Down Expand Up @@ -382,6 +381,16 @@ static int dspi_setup(struct spi_device *spi)
return dspi_setup_transfer(spi, NULL);
}

static void dspi_cleanup(struct spi_device *spi)
{
struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi);

dev_dbg(&spi->dev, "spi_device %u.%u cleanup\n",
spi->master->bus_num, spi->chip_select);

kfree(chip);
}

static irqreturn_t dspi_interrupt(int irq, void *dev_id)
{
struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id;
Expand Down Expand Up @@ -467,6 +476,7 @@ static int dspi_probe(struct platform_device *pdev)
dspi->bitbang.master->setup = dspi_setup;
dspi->bitbang.master->dev.of_node = pdev->dev.of_node;

master->cleanup = dspi_cleanup;
master->mode_bits = SPI_CPOL | SPI_CPHA;
master->bits_per_word_mask = SPI_BPW_MASK(4) | SPI_BPW_MASK(8) |
SPI_BPW_MASK(16);
Expand Down
4 changes: 4 additions & 0 deletions drivers/spi/spi-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,10 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
struct dma_slave_config slave_config = {};
int ret;

/* use pio mode for i.mx6dl chip TKT238285 */
if (of_machine_is_compatible("fsl,imx6dl"))
return 0;

/* Prepare for TX DMA: */
master->dma_tx = dma_request_slave_channel(dev, "tx");
if (!master->dma_tx) {
Expand Down

0 comments on commit d202c30

Please sign in to comment.