aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/tifm_sd.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-02-03 07:36:41 -0500
committerPierre Ossman <drzeus@drzeus.cx>2007-02-04 14:54:12 -0500
commitf9d429a2e579ed7c51c49a81265f7e7d2c59c197 (patch)
treee10cab71de9b660d1da22756eb406f57befd0da6 /drivers/mmc/tifm_sd.c
parentc70840e819acdbab96b8cdf71d27cb68c6567efa (diff)
mmc: tifm: replace kmap with page_address
Since we actively avoid highmem, calling kmap_atomic() instead of page_address() is effectively only obfuscation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/tifm_sd.c')
-rw-r--r--drivers/mmc/tifm_sd.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c
index 7e607b75f4bc..e65f8a0a9349 100644
--- a/drivers/mmc/tifm_sd.c
+++ b/drivers/mmc/tifm_sd.c
@@ -107,14 +107,9 @@ struct tifm_sd {
107 107
108}; 108};
109 109
110static char* tifm_sd_kmap_atomic(struct mmc_data *data) 110static char* tifm_sd_data_buffer(struct mmc_data *data)
111{ 111{
112 return kmap_atomic(data->sg->page, KM_BIO_SRC_IRQ) + data->sg->offset; 112 return page_address(data->sg->page) + data->sg->offset;
113}
114
115static void tifm_sd_kunmap_atomic(char *buffer, struct mmc_data *data)
116{
117 kunmap_atomic(buffer - data->sg->offset, KM_BIO_SRC_IRQ);
118} 113}
119 114
120static int tifm_sd_transfer_data(struct tifm_dev *sock, struct tifm_sd *host, 115static int tifm_sd_transfer_data(struct tifm_dev *sock, struct tifm_sd *host,
@@ -127,18 +122,17 @@ static int tifm_sd_transfer_data(struct tifm_dev *sock, struct tifm_sd *host,
127 if (host_status & TIFM_MMCSD_BRS) { 122 if (host_status & TIFM_MMCSD_BRS) {
128 /* in non-dma rx mode BRS fires when fifo is still not empty */ 123 /* in non-dma rx mode BRS fires when fifo is still not empty */
129 if (no_dma && (cmd->data->flags & MMC_DATA_READ)) { 124 if (no_dma && (cmd->data->flags & MMC_DATA_READ)) {
130 buffer = tifm_sd_kmap_atomic(host->req->data); 125 buffer = tifm_sd_data_buffer(host->req->data);
131 while (host->buffer_size > host->buffer_pos) { 126 while (host->buffer_size > host->buffer_pos) {
132 t_val = readl(sock->addr + SOCK_MMCSD_DATA); 127 t_val = readl(sock->addr + SOCK_MMCSD_DATA);
133 buffer[host->buffer_pos++] = t_val & 0xff; 128 buffer[host->buffer_pos++] = t_val & 0xff;
134 buffer[host->buffer_pos++] = 129 buffer[host->buffer_pos++] =
135 (t_val >> 8) & 0xff; 130 (t_val >> 8) & 0xff;
136 } 131 }
137 tifm_sd_kunmap_atomic(buffer, host->req->data);
138 } 132 }
139 return 1; 133 return 1;
140 } else if (no_dma) { 134 } else if (no_dma) {
141 buffer = tifm_sd_kmap_atomic(host->req->data); 135 buffer = tifm_sd_data_buffer(host->req->data);
142 if ((cmd->data->flags & MMC_DATA_READ) && 136 if ((cmd->data->flags & MMC_DATA_READ) &&
143 (host_status & TIFM_MMCSD_AF)) { 137 (host_status & TIFM_MMCSD_AF)) {
144 for (cnt = 0; cnt < TIFM_MMCSD_FIFO_SIZE; cnt++) { 138 for (cnt = 0; cnt < TIFM_MMCSD_FIFO_SIZE; cnt++) {
@@ -163,7 +157,6 @@ static int tifm_sd_transfer_data(struct tifm_dev *sock, struct tifm_sd *host,
163 } 157 }
164 } 158 }
165 } 159 }
166 tifm_sd_kunmap_atomic(buffer, host->req->data);
167 } 160 }
168 return 0; 161 return 0;
169} 162}