public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Chris Ball <cjb@laptop.org>,
	Anton Vorontsov <cbouatmailru@gmail.com>,
	Viresh Kumar <viresh.kumar@st.com>,
	David Brown <davidb@codeaurora.org>,
	linux-mmc@vger.kernel.org
Subject: [PATCH] mmc: pxamci: Use DIV_ROUND_UP at appropriate places
Date: Tue, 10 Apr 2012 10:00:10 +0800	[thread overview]
Message-ID: <1334023210.16328.3.camel@phoenix> (raw)

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




             reply	other threads:[~2012-04-10  2:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10  2:00 Axel Lin [this message]
2012-04-10  3:44 ` [PATCH] mmc: pxamci: Use DIV_ROUND_UP at appropriate places Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334023210.16328.3.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=cbouatmailru@gmail.com \
    --cc=cjb@laptop.org \
    --cc=davidb@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=viresh.kumar@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox