summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-04 10:40:52 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-07 12:19:45 +0100
commit9dfc9a8e752fe511fe2e844f522c8a5b059bedef (patch)
tree6254727791ba79448aa3b0a192c1e06bc8fbc077 /drivers/ata
parent57464c10a46aa05090c414dd3097875b780bab72 (diff)
downloadbarebox-9dfc9a8e752fe511fe2e844f522c8a5b059bedef.tar.gz
barebox-9dfc9a8e752fe511fe2e844f522c8a5b059bedef.tar.xz
ata: Use dma_alloc for buffer
ATA devices using DMA may need a sufficiently aligned buffer, so use dma_alloc instead of regular malloc. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/disk_ata_drive.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c
index a1df4bd22f..923be9a26c 100644
--- a/drivers/ata/disk_ata_drive.c
+++ b/drivers/ata/disk_ata_drive.c
@@ -24,6 +24,7 @@
#include <block.h>
#include <ata_drive.h>
#include <disks.h>
+#include <dma.h>
#define ata_id_u32(id,n) \
(((uint32_t) (id)[(n) + 1] << 16) | ((uint32_t) (id)[(n)]))
@@ -266,7 +267,7 @@ int ata_port_register(struct ata_port *port)
struct ata_port_operations *ops = port->ops;
struct device_d *dev = port->dev;
- port->id = xzalloc(SECTOR_SIZE);
+ port->id = dma_alloc(SECTOR_SIZE);
port->blk.dev = dev;
port->blk.ops = &ata_ops;