From 1cb110fb034e4edb5b7c72fbea72f3140d7f17ed Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 8 Mar 2013 10:18:08 +0100 Subject: [PATCH] ata: Add init callback to ata_port_operations Signed-off-by: Sascha Hauer --- drivers/ata/disk_ata_drive.c | 6 ++++++ include/ata_drive.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c index a6deb7437..6fe526acc 100644 --- a/drivers/ata/disk_ata_drive.c +++ b/drivers/ata/disk_ata_drive.c @@ -261,6 +261,12 @@ static int ata_port_init(struct ata_port *port) struct ata_port_operations *ops = port->ops; struct device_d *dev = &port->class_dev; + if (ops->init) { + rc = ops->init(port); + if (rc) + return rc; + } + port->id = dma_alloc(SECTOR_SIZE); port->blk.dev = dev; diff --git a/include/ata_drive.h b/include/ata_drive.h index 876aa7497..4f8b6c05f 100644 --- a/include/ata_drive.h +++ b/include/ata_drive.h @@ -80,6 +80,7 @@ struct ata_ioports { struct ata_port; struct ata_port_operations { + int (*init)(struct ata_port *port); int (*read)(struct ata_port *port, void *buf, unsigned int block, int num_blocks); int (*write)(struct ata_port *port, const void *buf, unsigned int block, int num_blocks); int (*read_id)(struct ata_port *port, void *buf);