diff --git a/[refs] b/[refs] index 9c465c97c33b..7cd51c9e4d9d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bb9c5687e8cd02d6f8a3aea40c118b439cb09501 +refs/heads/master: 35faa55cff56441477973e454f62408714f35cd3 diff --git a/trunk/drivers/spi/spi-fsl-espi.c b/trunk/drivers/spi/spi-fsl-espi.c index d770f03705c3..43350f999314 100644 --- a/trunk/drivers/spi/spi-fsl-espi.c +++ b/trunk/drivers/spi/spi-fsl-espi.c @@ -180,7 +180,7 @@ static int fsl_espi_setup_transfer(struct spi_device *spi, if ((mpc8xxx_spi->spibrg / hz) > 64) { cs->hw_mode |= CSMODE_DIV16; - pm = (mpc8xxx_spi->spibrg - 1) / (hz * 64) + 1; + pm = DIV_ROUND_UP(mpc8xxx_spi->spibrg, hz * 16 * 4); WARN_ONCE(pm > 16, "%s: Requested speed is too low: %d Hz. " "Will use %d Hz instead.\n", dev_name(&spi->dev), @@ -188,7 +188,7 @@ static int fsl_espi_setup_transfer(struct spi_device *spi, if (pm > 16) pm = 16; } else { - pm = (mpc8xxx_spi->spibrg - 1) / (hz * 4) + 1; + pm = DIV_ROUND_UP(mpc8xxx_spi->spibrg, hz * 4); } if (pm) pm--;