diff options
author | Manuel Lauss <manuel.lauss@gmail.com> | 2014-07-23 10:36:26 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-07-30 07:56:34 -0400 |
commit | 2f73bfbe0873452f4cd388ec2f67f8226fe93f79 (patch) | |
tree | 9070345314cad7ea65779636fce34284b4cd3637 /drivers/mtd/nand/au1550nd.c | |
parent | 9cf12167e909a86fbc4b39cf4cffef4cba40f1b3 (diff) |
MIPS: Alchemy: remove au_read/write/sync
replace au_read/write/sync with __raw_read/write and wmb.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/7465/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/mtd/nand/au1550nd.c')
-rw-r--r-- | drivers/mtd/nand/au1550nd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c index 6cece6e7ee6b..77d6c17b38c2 100644 --- a/drivers/mtd/nand/au1550nd.c +++ b/drivers/mtd/nand/au1550nd.c | |||
@@ -41,7 +41,7 @@ static u_char au_read_byte(struct mtd_info *mtd) | |||
41 | { | 41 | { |
42 | struct nand_chip *this = mtd->priv; | 42 | struct nand_chip *this = mtd->priv; |
43 | u_char ret = readb(this->IO_ADDR_R); | 43 | u_char ret = readb(this->IO_ADDR_R); |
44 | au_sync(); | 44 | wmb(); /* drain writebuffer */ |
45 | return ret; | 45 | return ret; |
46 | } | 46 | } |
47 | 47 | ||
@@ -56,7 +56,7 @@ static void au_write_byte(struct mtd_info *mtd, u_char byte) | |||
56 | { | 56 | { |
57 | struct nand_chip *this = mtd->priv; | 57 | struct nand_chip *this = mtd->priv; |
58 | writeb(byte, this->IO_ADDR_W); | 58 | writeb(byte, this->IO_ADDR_W); |
59 | au_sync(); | 59 | wmb(); /* drain writebuffer */ |
60 | } | 60 | } |
61 | 61 | ||
62 | /** | 62 | /** |
@@ -69,7 +69,7 @@ static u_char au_read_byte16(struct mtd_info *mtd) | |||
69 | { | 69 | { |
70 | struct nand_chip *this = mtd->priv; | 70 | struct nand_chip *this = mtd->priv; |
71 | u_char ret = (u_char) cpu_to_le16(readw(this->IO_ADDR_R)); | 71 | u_char ret = (u_char) cpu_to_le16(readw(this->IO_ADDR_R)); |
72 | au_sync(); | 72 | wmb(); /* drain writebuffer */ |
73 | return ret; | 73 | return ret; |
74 | } | 74 | } |
75 | 75 | ||
@@ -84,7 +84,7 @@ static void au_write_byte16(struct mtd_info *mtd, u_char byte) | |||
84 | { | 84 | { |
85 | struct nand_chip *this = mtd->priv; | 85 | struct nand_chip *this = mtd->priv; |
86 | writew(le16_to_cpu((u16) byte), this->IO_ADDR_W); | 86 | writew(le16_to_cpu((u16) byte), this->IO_ADDR_W); |
87 | au_sync(); | 87 | wmb(); /* drain writebuffer */ |
88 | } | 88 | } |
89 | 89 | ||
90 | /** | 90 | /** |
@@ -97,7 +97,7 @@ static u16 au_read_word(struct mtd_info *mtd) | |||
97 | { | 97 | { |
98 | struct nand_chip *this = mtd->priv; | 98 | struct nand_chip *this = mtd->priv; |
99 | u16 ret = readw(this->IO_ADDR_R); | 99 | u16 ret = readw(this->IO_ADDR_R); |
100 | au_sync(); | 100 | wmb(); /* drain writebuffer */ |
101 | return ret; | 101 | return ret; |
102 | } | 102 | } |
103 | 103 | ||
@@ -116,7 +116,7 @@ static void au_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | |||
116 | 116 | ||
117 | for (i = 0; i < len; i++) { | 117 | for (i = 0; i < len; i++) { |
118 | writeb(buf[i], this->IO_ADDR_W); | 118 | writeb(buf[i], this->IO_ADDR_W); |
119 | au_sync(); | 119 | wmb(); /* drain writebuffer */ |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
@@ -135,7 +135,7 @@ static void au_read_buf(struct mtd_info *mtd, u_char *buf, int len) | |||
135 | 135 | ||
136 | for (i = 0; i < len; i++) { | 136 | for (i = 0; i < len; i++) { |
137 | buf[i] = readb(this->IO_ADDR_R); | 137 | buf[i] = readb(this->IO_ADDR_R); |
138 | au_sync(); | 138 | wmb(); /* drain writebuffer */ |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
@@ -156,7 +156,7 @@ static void au_write_buf16(struct mtd_info *mtd, const u_char *buf, int len) | |||
156 | 156 | ||
157 | for (i = 0; i < len; i++) { | 157 | for (i = 0; i < len; i++) { |
158 | writew(p[i], this->IO_ADDR_W); | 158 | writew(p[i], this->IO_ADDR_W); |
159 | au_sync(); | 159 | wmb(); /* drain writebuffer */ |
160 | } | 160 | } |
161 | 161 | ||
162 | } | 162 | } |
@@ -178,7 +178,7 @@ static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) | |||
178 | 178 | ||
179 | for (i = 0; i < len; i++) { | 179 | for (i = 0; i < len; i++) { |
180 | p[i] = readw(this->IO_ADDR_R); | 180 | p[i] = readw(this->IO_ADDR_R); |
181 | au_sync(); | 181 | wmb(); /* drain writebuffer */ |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
@@ -234,8 +234,7 @@ static void au1550_hwcontrol(struct mtd_info *mtd, int cmd) | |||
234 | 234 | ||
235 | this->IO_ADDR_R = this->IO_ADDR_W; | 235 | this->IO_ADDR_R = this->IO_ADDR_W; |
236 | 236 | ||
237 | /* Drain the writebuffer */ | 237 | wmb(); /* Drain the writebuffer */ |
238 | au_sync(); | ||
239 | } | 238 | } |
240 | 239 | ||
241 | int au1550_device_ready(struct mtd_info *mtd) | 240 | int au1550_device_ready(struct mtd_info *mtd) |