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 3/5] ata: Add init callback to ata_port_operations
Date: Fri,  8 Mar 2013 11:35:49 +0100	[thread overview]
Message-ID: <1362738951-25614-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1362738951-25614-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/ata/disk_ata_drive.c | 6 ++++++
 include/ata_drive.h          | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c
index a6deb74..6fe526a 100644
--- a/drivers/ata/disk_ata_drive.c
+++ b/drivers/ata/disk_ata_drive.c
@@ -261,6 +261,12 @@ static int ata_port_init(struct ata_port *port)
 	struct ata_port_operations *ops = port->ops;
 	struct device_d *dev = &port->class_dev;
 
+	if (ops->init) {
+		rc = ops->init(port);
+		if (rc)
+			return rc;
+	}
+
 	port->id = dma_alloc(SECTOR_SIZE);
 
 	port->blk.dev = dev;
diff --git a/include/ata_drive.h b/include/ata_drive.h
index 876aa74..4f8b6c0 100644
--- a/include/ata_drive.h
+++ b/include/ata_drive.h
@@ -80,6 +80,7 @@ struct ata_ioports {
 struct ata_port;
 
 struct ata_port_operations {
+	int (*init)(struct ata_port *port);
 	int (*read)(struct ata_port *port, void *buf, unsigned int block, int num_blocks);
 	int (*write)(struct ata_port *port, const void *buf, unsigned int block, int num_blocks);
 	int (*read_id)(struct ata_port *port, void *buf);
-- 
1.8.2.rc2


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

  parent reply	other threads:[~2013-03-08 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 10:35 [PATCH] ata/ahci work Sascha Hauer
2013-03-08 10:35 ` [PATCH 1/5] ata: ahci: fix wrong link check Sascha Hauer
2013-03-08 10:35 ` [PATCH 2/5] ata: add ata logical device to defer probe Sascha Hauer
2013-03-08 10:35 ` Sascha Hauer [this message]
2013-03-08 10:35 ` [PATCH 4/5] ata: ahci: implement init callback Sascha Hauer
2013-03-08 10:35 ` [PATCH 5/5] ata: ahci: refactor init functions 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=1362738951-25614-4-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