[PATCH 2/4] ata: Add detect callback for hardware device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux