summaryrefslogtreecommitdiffstats
path: root/common/partitions.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-06-21 10:27:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-30 12:46:25 +0200
commit527772ca0ea0447d8c5394e9d6bc1581bdf06835 (patch)
treedfa813c68eaee551a7c77e256399eec7cb4eccdf /common/partitions.c
parent9895357a71205ea7d92d7608bd5ea40cef38e4c1 (diff)
downloadbarebox-527772ca0ea0447d8c5394e9d6bc1581bdf06835.tar.gz
partition: Use dma_alloc for allocating buffers
Drivers may use dma to transfer blocks, so put them into dma save memory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/partitions.c')
-rw-r--r--common/partitions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/partitions.c b/common/partitions.c
index 74b4f12..3d92838 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;
@@ -102,7 +103,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);
@@ -142,7 +143,7 @@ static void __maybe_unused try_dos_partition(struct block_device *blk,
}
on_error:
- free(buffer);
+ dma_free(buffer);
}
/**