]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/ata_generic.c
sysfs: fix /sys/module/*/holders after sysfs logic change
[linux-2.6-omap-h63xx.git] / drivers / ata / ata_generic.c
index 9454669547244e5960e05c5bd9741d6a3efc90fb..90329982bef760fe6a4cadead1f1d526943f4958 100644 (file)
@@ -34,7 +34,7 @@
 
 /**
  *     generic_set_mode        -       mode setting
- *     @ap: interface to set up
+ *     @link: link to set up
  *     @unused: returned device on error
  *
  *     Use a non standard set_mode function. We don't want to be tuned.
  *     and respect them.
  */
 
-static int generic_set_mode(struct ata_port *ap, struct ata_device **unused)
+static int generic_set_mode(struct ata_link *link, struct ata_device **unused)
 {
+       struct ata_port *ap = link->ap;
        int dma_enabled = 0;
-       int i;
+       struct ata_device *dev;
 
        /* Bits 5 and 6 indicate if DMA is active on master/slave */
        if (ap->ioaddr.bmdma_addr)
                dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
 
-       for (i = 0; i < ATA_MAX_DEVICES; i++) {
-               struct ata_device *dev = &ap->device[i];
+       ata_link_for_each_dev(dev, link) {
                if (ata_dev_enabled(dev)) {
                        /* We don't really care */
                        dev->pio_mode = XFER_PIO_0;
                        dev->dma_mode = XFER_MW_DMA_0;
                        /* We do need the right mode information for DMA or PIO
                           and this comes from the current configuration flags */
-                       if (dma_enabled & (1 << (5 + i))) {
+                       if (dma_enabled & (1 << (5 + dev->devno))) {
                                ata_id_to_dma_mode(dev, XFER_MW_DMA_0);
                                dev->flags &= ~ATA_DFLAG_PIO;
                        } else {
@@ -95,7 +95,6 @@ static struct scsi_host_template generic_sht = {
 static struct ata_port_operations generic_port_ops = {
        .set_mode       = generic_set_mode,
 
-       .port_disable   = ata_port_disable,
        .tf_load        = ata_tf_load,
        .tf_read        = ata_tf_read,
        .check_status   = ata_check_status,
@@ -121,9 +120,8 @@ static struct ata_port_operations generic_port_ops = {
        .irq_handler    = ata_interrupt,
        .irq_clear      = ata_bmdma_irq_clear,
        .irq_on         = ata_irq_on,
-       .irq_ack        = ata_irq_ack,
 
-       .port_start     = ata_port_start,
+       .port_start     = ata_sff_port_start,
 };
 
 static int all_generic_ide;            /* Set to claim all devices */