[PATCH] ATA: Implement a hook for 'devinfo'

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

 



Implement simple adapter function to serve as a hook for 'devinfo'
command.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 drivers/ata/disk_ata_drive.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c
index d30d0ad..9b3730c 100644
--- a/drivers/ata/disk_ata_drive.c
+++ b/drivers/ata/disk_ata_drive.c
@@ -303,6 +303,14 @@ static int ata_detect(struct device_d *dev)
 	return ata_port_detect(port);
 }
 
+static void ata_info(struct device_d *dev)
+{
+	struct ata_port *port = container_of(dev, struct ata_port, class_dev);
+
+	if (port->initialized)
+		ata_dump_id(port->id);
+}
+
 /**
  * Register an ATA drive behind an IDE like interface
  * @param dev The interface device
@@ -322,6 +330,7 @@ int ata_port_register(struct ata_port *port)
 	}
 
 	port->class_dev.parent = port->dev;
+	port->class_dev.info   = ata_info;
 	port->class_dev.detect = ata_detect;
 
 	ret = register_device(&port->class_dev);
-- 
2.5.5


_______________________________________________
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