diff options
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index ce61be98e06d..4988230a7e0c 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) |