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 2/4] ata: Add detect callback for hardware device
Date: Mon, 17 Jun 2013 10:59:14 +0200	[thread overview]
Message-ID: <1371459556-24073-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1371459556-24073-1-git-send-email-s.hauer@pengutronix.de>

To be able to use the 'detect' command on hardware devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/ata/disk_ata_drive.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c
index 4ad7564..4c82797 100644
--- a/drivers/ata/disk_ata_drive.c
+++ b/drivers/ata/disk_ata_drive.c
@@ -360,6 +360,13 @@ static int ata_detect(struct device_d *dev)
 	return ata_port_detect(port);
 }
 
+static int ata_detect_hw(struct device_d *dev)
+{
+	struct ata_port *port = dev->priv;
+
+	return ata_port_detect(port);
+}
+
 /**
  * Register an ATA drive behind an IDE like interface
  * @param dev The interface device
@@ -379,6 +386,9 @@ int ata_port_register(struct ata_port *port)
 	if (ret)
 		return ret;
 
+	port->dev->priv = port;
+	port->dev->detect = ata_detect_hw;
+
 	dev_add_param_bool(&port->class_dev, "probe", ata_set_probe,
 			NULL, &port->probe, port);
 
-- 
1.8.3.1


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

  reply	other threads:[~2013-06-17  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17  8:59 [PATCH 1/4] ata: implement detect callback Sascha Hauer
2013-06-17  8:59 ` Sascha Hauer [this message]
2013-06-17  8:59 ` [PATCH 3/4] ata: ide: Allow to set the devicename Sascha Hauer
2013-06-17  8:59 ` [PATCH 4/4] ata: i.MX pata: Add devicetree probe 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=1371459556-24073-2-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