mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 5/9] ata: Use dma_alloc for buffer
Date: Thu,  6 Dec 2012 14:34:26 +0100	[thread overview]
Message-ID: <1354800870-28385-6-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1354800870-28385-1-git-send-email-s.hauer@pengutronix.de>

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>
---
 drivers/ata/disk_ata_drive.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c
index a1df4bd..923be9a 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;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-12-06 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 13:34 [PATCH] AHCI support Sascha Hauer
2012-12-06 13:34 ` [PATCH 1/9] ata: register disks as /dev/ata* Sascha Hauer
2012-12-06 13:34 ` [PATCH 2/9] ata: fix status flags Sascha Hauer
2012-12-06 13:34 ` [PATCH 3/9] ata: split ide sff suport to separate file Sascha Hauer
2012-12-06 13:34 ` [PATCH 4/9] ata: align ata command defines with kernel Sascha Hauer
2012-12-06 13:34 ` Sascha Hauer [this message]
2012-12-06 13:34 ` [PATCH 6/9] ata: Add ahci support Sascha Hauer
2012-12-06 13:34 ` [PATCH 7/9] mfd: Add i.MX6 iomux gpr header file Sascha Hauer
2012-12-06 13:34 ` [PATCH 8/9] ata: Add i.MX AHCI driver Sascha Hauer
2012-12-06 13:34 ` [PATCH 9/9] ARM i.MX5: Add SATA support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354800870-28385-6-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox