linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: pxamci: Use DIV_ROUND_UP at appropriate places
@ 2012-04-10  2:00 Axel Lin
  2012-04-10  3:44 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-04-10  2:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Chris Ball, Anton Vorontsov, Viresh Kumar, David Brown, linux-mmc

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mmc/host/pxamci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index cb2dc0e..4b89e73 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -190,7 +190,7 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
 	clks = (unsigned long long)data->timeout_ns * host->clkrate;
 	do_div(clks, 1000000000UL);
 	timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt);
-	writel((timeout + 255) / 256, host->base + MMC_RDTO);
+	writel(DIV_ROUND_UP(timeout, 256), host->base + MMC_RDTO);
 
 	if (data->flags & MMC_DATA_READ) {
 		host->dma_dir = DMA_FROM_DEVICE;
@@ -636,7 +636,7 @@ static int pxamci_probe(struct platform_device *pdev)
 	/*
 	 * Calculate minimum clock rate, rounding up.
 	 */
-	mmc->f_min = (host->clkrate + 63) / 64;
+	mmc->f_min = DIV_ROUND_UP(host->clkrate, 64);
 	mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate;
 
 	pxamci_init_ocr(host);
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: pxamci: Use DIV_ROUND_UP at appropriate places
  2012-04-10  2:00 [PATCH] mmc: pxamci: Use DIV_ROUND_UP at appropriate places Axel Lin
@ 2012-04-10  3:44 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2012-04-10  3:44 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel@vger.kernel.org, Chris Ball, Anton Vorontsov,
	David Brown, linux-mmc@vger.kernel.org

On 4/10/2012 7:30 AM, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/mmc/host/pxamci.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
> index cb2dc0e..4b89e73 100644
> --- a/drivers/mmc/host/pxamci.c
> +++ b/drivers/mmc/host/pxamci.c
> @@ -190,7 +190,7 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
>  	clks = (unsigned long long)data->timeout_ns * host->clkrate;
>  	do_div(clks, 1000000000UL);
>  	timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt);
> -	writel((timeout + 255) / 256, host->base + MMC_RDTO);
> +	writel(DIV_ROUND_UP(timeout, 256), host->base + MMC_RDTO);
>  
>  	if (data->flags & MMC_DATA_READ) {
>  		host->dma_dir = DMA_FROM_DEVICE;
> @@ -636,7 +636,7 @@ static int pxamci_probe(struct platform_device *pdev)
>  	/*
>  	 * Calculate minimum clock rate, rounding up.
>  	 */
> -	mmc->f_min = (host->clkrate + 63) / 64;
> +	mmc->f_min = DIV_ROUND_UP(host->clkrate, 64);
>  	mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate;
>  
>  	pxamci_init_ocr(host);

Reviewed-by: Viresh Kumar <viresh.kumar@st.com>

-- 
viresh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-10  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10  2:00 [PATCH] mmc: pxamci: Use DIV_ROUND_UP at appropriate places Axel Lin
2012-04-10  3:44 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).