diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-01 09:12:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-01 09:12:56 -0400 |
commit | b262e60309e1b0eb25d300c7e739427d5316abb1 (patch) | |
tree | bf319d78c79bb5cb617ff0c8340c73aa349bba15 /drivers/spi/spi_mpc83xx.c | |
parent | 93c8b90f01f0dc73891da4e84b26524b61d29d66 (diff) | |
parent | 0523820482dcb42784572ffd2296c2f08c275a2b (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/ath9k/core.c
drivers/net/wireless/ath9k/main.c
net/core/dev.c
Diffstat (limited to 'drivers/spi/spi_mpc83xx.c')
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 070c6219e2d6..ac0e3e4b3c54 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -267,16 +267,13 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) | |||
267 | cs->hw_mode |= SPMODE_LEN(bits_per_word); | 267 | cs->hw_mode |= SPMODE_LEN(bits_per_word); |
268 | 268 | ||
269 | if ((mpc83xx_spi->spibrg / hz) > 64) { | 269 | if ((mpc83xx_spi->spibrg / hz) > 64) { |
270 | cs->hw_mode |= SPMODE_DIV16; | ||
270 | pm = mpc83xx_spi->spibrg / (hz * 64); | 271 | pm = mpc83xx_spi->spibrg / (hz * 64); |
271 | if (pm > 16) { | 272 | if (pm > 16) { |
272 | cs->hw_mode |= SPMODE_DIV16; | 273 | dev_err(&spi->dev, "Requested speed is too " |
273 | pm /= 16; | 274 | "low: %d Hz. Will use %d Hz instead.\n", |
274 | if (pm > 16) { | 275 | hz, mpc83xx_spi->spibrg / 1024); |
275 | dev_err(&spi->dev, "Requested speed is too " | 276 | pm = 16; |
276 | "low: %d Hz. Will use %d Hz instead.\n", | ||
277 | hz, mpc83xx_spi->spibrg / 1024); | ||
278 | pm = 16; | ||
279 | } | ||
280 | } | 277 | } |
281 | } else | 278 | } else |
282 | pm = mpc83xx_spi->spibrg / (hz * 4); | 279 | pm = mpc83xx_spi->spibrg / (hz * 4); |
@@ -315,11 +312,20 @@ static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
315 | if (t->bits_per_word) | 312 | if (t->bits_per_word) |
316 | bits_per_word = t->bits_per_word; | 313 | bits_per_word = t->bits_per_word; |
317 | len = t->len; | 314 | len = t->len; |
318 | if (bits_per_word > 8) | 315 | if (bits_per_word > 8) { |
316 | /* invalid length? */ | ||
317 | if (len & 1) | ||
318 | return -EINVAL; | ||
319 | len /= 2; | 319 | len /= 2; |
320 | if (bits_per_word > 16) | 320 | } |
321 | if (bits_per_word > 16) { | ||
322 | /* invalid length? */ | ||
323 | if (len & 1) | ||
324 | return -EINVAL; | ||
321 | len /= 2; | 325 | len /= 2; |
326 | } | ||
322 | mpc83xx_spi->count = len; | 327 | mpc83xx_spi->count = len; |
328 | |||
323 | INIT_COMPLETION(mpc83xx_spi->done); | 329 | INIT_COMPLETION(mpc83xx_spi->done); |
324 | 330 | ||
325 | /* enable rx ints */ | 331 | /* enable rx ints */ |