X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fide%2Fpci%2Fopti621.c;h=6048eda3cd613711f05fa44226857bb66faff51c;hb=5fdf11283e26719543eb5f9b68707e1af77eb875;hp=e28e672ddafcf9dd5cd940792f4961cc82f179c5;hpb=96e2e6fafaedd83bd899f682907e14d1eec17390;p=linux-2.6-omap-h63xx.git diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index e28e672ddaf..6048eda3cd6 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c @@ -85,7 +85,6 @@ #include #include #include -#include #include #include @@ -137,7 +136,7 @@ static u8 read_reg(int reg) static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) { ide_hwif_t *hwif = drive->hwif; - ide_drive_t *pair = ide_get_paired_drive(drive); + ide_drive_t *pair = ide_get_pair_dev(drive); unsigned long flags; u8 tim, misc, addr_pio = pio, clk; @@ -153,7 +152,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) drive->drive_data = XFER_PIO_0 + pio; - if (pair->present) { + if (pair) { if (pair->drive_data && pair->drive_data < drive->drive_data) addr_pio = pair->drive_data - XFER_PIO_0; } @@ -180,7 +179,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio) misc = addr_timings[clk][addr_pio]; /* select Index-0/1 for Register-A/B */ - write_reg(drive->select.b.unit, MISC_REG); + write_reg(drive->dn & 1, MISC_REG); /* set read cycle timings */ write_reg(tim, READ_REG); /* set write cycle timings */ @@ -221,21 +220,23 @@ static const struct pci_device_id opti621_pci_tbl[] = { }; MODULE_DEVICE_TABLE(pci, opti621_pci_tbl); -static struct pci_driver driver = { +static struct pci_driver opti621_pci_driver = { .name = "Opti621_IDE", .id_table = opti621_pci_tbl, .probe = opti621_init_one, .remove = ide_pci_remove, + .suspend = ide_pci_suspend, + .resume = ide_pci_resume, }; static int __init opti621_ide_init(void) { - return ide_pci_register_driver(&driver); + return ide_pci_register_driver(&opti621_pci_driver); } static void __exit opti621_ide_exit(void) { - pci_unregister_driver(&driver); + pci_unregister_driver(&opti621_pci_driver); } module_init(opti621_ide_init);