summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-07-02 10:59:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-07-02 10:59:22 +0200
commitdd3c898d06a55a4c6fe94dae3f732a541e983432 (patch)
tree9f8ea0b057a6a1b52c948214d27ccde9378326a9 /common
parent649f558483f9959c0ac4123da8c7b647d9808be5 (diff)
parent40faf584cd60c1e0e083ac75eb9ef5f9e7c071d0 (diff)
downloadbarebox-dd3c898d06a55a4c6fe94dae3f732a541e983432.tar.gz
Merge branch 'for-next/dma-cache-align'
Diffstat (limited to 'common')
-rw-r--r--common/block.c7
-rw-r--r--common/partitions.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/common/block.c b/common/block.c
index e40374f..7ad5ecc 100644
--- a/common/block.c
+++ b/common/block.c
@@ -24,6 +24,7 @@
#include <malloc.h>
#include <linux/err.h>
#include <linux/list.h>
+#include <dma.h>
#define BLOCKSIZE(blk) (1 << blk->blockbits)
@@ -357,7 +358,7 @@ int blockdevice_register(struct block_device *blk)
for (i = 0; i < 8; i++) {
struct chunk *chunk = xzalloc(sizeof(*chunk));
- chunk->data = xmalloc(BUFSIZE);
+ chunk->data = dma_alloc(BUFSIZE);
chunk->num = i;
list_add_tail(&chunk->list, &blk->idle_blocks);
}
@@ -376,12 +377,12 @@ int blockdevice_unregister(struct block_device *blk)
writebuffer_flush(blk);
list_for_each_entry_safe(chunk, tmp, &blk->buffered_blocks, list) {
- free(chunk->data);
+ dma_free(chunk->data);
free(chunk);
}
list_for_each_entry_safe(chunk, tmp, &blk->idle_blocks, list) {
- free(chunk->data);
+ dma_free(chunk->data);
free(chunk);
}
diff --git a/common/partitions.c b/common/partitions.c
index a8c9625..dc91933 100644
--- a/common/partitions.c
+++ b/common/partitions.c
@@ -31,6 +31,7 @@
#include <block.h>
#include <asm/unaligned.h>
#include <disks.h>
+#include <dma.h>
struct partition {
uint64_t first_sec;
@@ -79,7 +80,7 @@ static void __maybe_unused try_dos_partition(struct block_device *blk,
struct partition pentry;
int i, rc;
- buffer = xmalloc(SECTOR_SIZE);
+ buffer = dma_alloc(SECTOR_SIZE);
/* read in the MBR to get the partition table */
rc = blk->ops->read(blk, buffer, 0, 1);
@@ -113,7 +114,7 @@ static void __maybe_unused try_dos_partition(struct block_device *blk,
}
on_error:
- free(buffer);
+ dma_free(buffer);
}
/**