mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ATA: Implement a hook for 'devinfo'
@ 2016-04-27 14:38 Andrey Smirnov
  2016-04-28 14:34 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Smirnov @ 2016-04-27 14:38 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

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

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ATA: Implement a hook for 'devinfo'
  2016-04-27 14:38 [PATCH] ATA: Implement a hook for 'devinfo' Andrey Smirnov
@ 2016-04-28 14:34 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-04-28 14:34 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Wed, Apr 27, 2016 at 07:38:13AM -0700, Andrey Smirnov wrote:
> Implement simple adapter function to serve as a hook for 'devinfo'
> command.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  drivers/ata/disk_ata_drive.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Applied, thanks

Sascha

> 
> 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@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-28 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27 14:38 [PATCH] ATA: Implement a hook for 'devinfo' Andrey Smirnov
2016-04-28 14:34 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox