brcm2708: update against latest rpi-3.10.y branch
[openwrt/svn-archive/archive.git] / target / linux / brcm2708 / patches-3.10 / 0018-Use-ndelay-rather-than-udelay.-Thanks-lb.patch
1 From a56370b5a103f3949c5ed2997a971e1949a15132 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Fri, 22 Jun 2012 12:57:42 +0100
4 Subject: [PATCH 018/174] Use ndelay rather than udelay. Thanks lb
5
6 ---
7 drivers/mmc/host/sdhci-bcm2708.c | 8 ++++----
8 1 file changed, 4 insertions(+), 4 deletions(-)
9
10 --- a/drivers/mmc/host/sdhci-bcm2708.c
11 +++ b/drivers/mmc/host/sdhci-bcm2708.c
12 @@ -249,14 +249,14 @@ static void sdhci_bcm2708_raw_writel(str
13 if (now == last_write_hpt || now == last_write_hpt+1) {
14 /* we can't guarantee any significant time has
15 * passed - we'll have to wait anyway ! */
16 - udelay((ns_2clk+1000-1)/1000);
17 + ndelay(ns_2clk);
18 } else
19 {
20 /* we must have waited at least this many ns: */
21 unsigned int ns_wait = HPTIME_CLK_NS *
22 (last_write_hpt - now - 1);
23 if (ns_wait < ns_2clk)
24 - udelay((ns_2clk-ns_wait+500)/1000);
25 + ndelay(ns_2clk - ns_wait);
26 }
27 last_write_hpt = now;
28 }
29 @@ -272,13 +272,13 @@ static void sdhci_bcm2708_raw_writel(str
30 ier &= ~SDHCI_INT_DATA_TIMEOUT;
31 writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
32 timeout_disabled = true;
33 - udelay((ns_2clk+1000-1)/1000);
34 + ndelay(ns_2clk);
35 } else if (timeout_disabled) {
36 ier = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
37 ier |= SDHCI_INT_DATA_TIMEOUT;
38 writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
39 timeout_disabled = false;
40 - udelay((ns_2clk+1000-1)/1000);
41 + ndelay(ns_2clk);
42 }
43 #endif
44 writel(val, host->ioaddr + reg);