diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2016-04-27 07:38:13 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-28 16:43:14 +0200 |
commit | 469950f3dbf8358a17965c8168e4f0d8dd29fec9 (patch) | |
tree | b9852a25dcc2a3704b8d79590af6b494264f95f2 /drivers/ata | |
parent | 52da32ec4d9c918af860d43ea6698a621045a7d4 (diff) | |
download | barebox-469950f3dbf8358a17965c8168e4f0d8dd29fec9.tar.gz barebox-469950f3dbf8358a17965c8168e4f0d8dd29fec9.tar.xz |
ATA: Implement a hook for 'devinfo'
Implement simple adapter function to serve as a hook for 'devinfo'
command.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/disk_ata_drive.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c index d30d0ad997..9b3730c8c4 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); |