9
0
Fork 0

ata: Add init callback to ata_port_operations

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-03-08 10:18:08 +01:00
parent a2063d1015
commit 1cb110fb03
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -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);