aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_mpc83xx.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-06-18 19:49:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-19 19:46:04 -0400
commitfd8a11e100b463811f41266ea3880c830f3359ea (patch)
treead26d74766e03088b6c783ed12f312668d32dd74 /drivers/spi/spi_mpc83xx.c
parent9e04b3336a90efef6a912501155f9880abf7b3c2 (diff)
spi_mpc83xx: quieten down the "Requested speed is too low" message
When a platform is running at high frequencies it's not always possible to scale-down a frequency to a requested value, and using mmc_spi driver this leads to the following printk flood during card polling: ... mmc_spi spi32766.0: Requested speed is too low: 400000 Hz. Will use 520828 Hz instead. mmc_spi spi32766.0: Requested speed is too low: 400000 Hz. Will use 520828 Hz instead. ... Fix this by using WARN_ONCE(), it's better than the flood, and also better than turning dev_err() into dev_dbg(), since we actually want to warn that some things may not work correctly. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi/spi_mpc83xx.c')
-rw-r--r--drivers/spi/spi_mpc83xx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index ce61be98e06..4988230a7e0 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/bug.h>
17#include <linux/errno.h> 18#include <linux/errno.h>
18#include <linux/err.h> 19#include <linux/err.h>
19#include <linux/completion.h> 20#include <linux/completion.h>
@@ -275,12 +276,12 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
275 if ((mpc83xx_spi->spibrg / hz) > 64) { 276 if ((mpc83xx_spi->spibrg / hz) > 64) {
276 cs->hw_mode |= SPMODE_DIV16; 277 cs->hw_mode |= SPMODE_DIV16;
277 pm = mpc83xx_spi->spibrg / (hz * 64); 278 pm = mpc83xx_spi->spibrg / (hz * 64);
278 if (pm > 16) { 279
279 dev_err(&spi->dev, "Requested speed is too " 280 WARN_ONCE(pm > 16, "%s: Requested speed is too low: %d Hz. "
280 "low: %d Hz. Will use %d Hz instead.\n", 281 "Will use %d Hz instead.\n", dev_name(&spi->dev),
281 hz, mpc83xx_spi->spibrg / 1024); 282 hz, mpc83xx_spi->spibrg / 1024);
283 if (pm > 16)
282 pm = 16; 284 pm = 16;
283 }
284 } else 285 } else
285 pm = mpc83xx_spi->spibrg / (hz * 4); 286 pm = mpc83xx_spi->spibrg / (hz * 4);
286 if (pm) 287 if (pm)