[PATCH 2/3] ata: pata-imx: implement detect callback for hardware device
Sascha Hauer
s.hauer at pengutronix.de
Thu Jun 20 10:00:53 EDT 2013
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/ata/pata-imx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/ata/pata-imx.c b/drivers/ata/pata-imx.c
index aed6df1..93809c2 100644
--- a/drivers/ata/pata-imx.c
+++ b/drivers/ata/pata-imx.c
@@ -146,6 +146,13 @@ static void imx_pata_setup_port(void *reg_base, void *alt_base,
}
}
+static int pata_imx_detect(struct device_d *dev)
+{
+ struct ide_port *ide = dev->priv;
+
+ return ata_port_detect(&ide->port);
+}
+
static int imx_pata_probe(struct device_d *dev)
{
struct ide_port *ide;
@@ -182,6 +189,9 @@ static int imx_pata_probe(struct device_d *dev)
ide->port.dev = dev;
ide->port.devname = devname;
+ dev->priv = ide;
+ dev->detect = pata_imx_detect;
+
ret = ide_port_register(ide);
if (ret) {
dev_err(dev, "Cannot register IDE interface: %s\n",
--
1.8.3.1
More information about the barebox
mailing list