diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-18 20:01:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-18 20:01:19 -0400 |
commit | 9d20593a722c2dab7a5ab74f5d8c9b604aca52f9 (patch) | |
tree | b5492b3191f29f68018c4d76f41f8bab379db0c5 /drivers/spi | |
parent | 9b59a0a4eefa132a3899b6e8d362f92559c67844 (diff) | |
parent | 9205124c66a69664c6825501cb062ebd2acd3b3a (diff) |
Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6
* 'merge' of git://git.secretlab.ca/git/linux-2.6:
powerpc/5200: Build fix for mpc52xx watchdog timer code
of: Fix comparison of "compatible" properties
powerpc/52xx: update defconfigs
spi/omap2_mcspi: Use transaction speed if provided
spi/omap2_mcspi: fix NULL pointer dereference
uartlite: Fix build on sparc.
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/omap2_mcspi.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 715c518b1b68..4dd786b99b8b 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c | |||
@@ -578,6 +578,7 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi, | |||
578 | struct spi_master *spi_cntrl; | 578 | struct spi_master *spi_cntrl; |
579 | u32 l = 0, div = 0; | 579 | u32 l = 0, div = 0; |
580 | u8 word_len = spi->bits_per_word; | 580 | u8 word_len = spi->bits_per_word; |
581 | u32 speed_hz = spi->max_speed_hz; | ||
581 | 582 | ||
582 | mcspi = spi_master_get_devdata(spi->master); | 583 | mcspi = spi_master_get_devdata(spi->master); |
583 | spi_cntrl = mcspi->master; | 584 | spi_cntrl = mcspi->master; |
@@ -587,9 +588,12 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi, | |||
587 | 588 | ||
588 | cs->word_len = word_len; | 589 | cs->word_len = word_len; |
589 | 590 | ||
590 | if (spi->max_speed_hz) { | 591 | if (t && t->speed_hz) |
592 | speed_hz = t->speed_hz; | ||
593 | |||
594 | if (speed_hz) { | ||
591 | while (div <= 15 && (OMAP2_MCSPI_MAX_FREQ / (1 << div)) | 595 | while (div <= 15 && (OMAP2_MCSPI_MAX_FREQ / (1 << div)) |
592 | > spi->max_speed_hz) | 596 | > speed_hz) |
593 | div++; | 597 | div++; |
594 | } else | 598 | } else |
595 | div = 15; | 599 | div = 15; |
@@ -751,11 +755,13 @@ static void omap2_mcspi_cleanup(struct spi_device *spi) | |||
751 | mcspi = spi_master_get_devdata(spi->master); | 755 | mcspi = spi_master_get_devdata(spi->master); |
752 | mcspi_dma = &mcspi->dma_channels[spi->chip_select]; | 756 | mcspi_dma = &mcspi->dma_channels[spi->chip_select]; |
753 | 757 | ||
754 | /* Unlink controller state from context save list */ | 758 | if (spi->controller_state) { |
755 | cs = spi->controller_state; | 759 | /* Unlink controller state from context save list */ |
756 | list_del(&cs->node); | 760 | cs = spi->controller_state; |
761 | list_del(&cs->node); | ||
757 | 762 | ||
758 | kfree(spi->controller_state); | 763 | kfree(spi->controller_state); |
764 | } | ||
759 | 765 | ||
760 | if (mcspi_dma->dma_rx_channel != -1) { | 766 | if (mcspi_dma->dma_rx_channel != -1) { |
761 | omap_free_dma(mcspi_dma->dma_rx_channel); | 767 | omap_free_dma(mcspi_dma->dma_rx_channel); |