Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[safe/jmp/linux-2.6] / drivers / ata / pata_rz1000.c
index 7dfd1f3..4a454a8 100644 (file)
@@ -38,15 +38,13 @@ static int rz1000_set_mode(struct ata_link *link, struct ata_device **unused)
 {
        struct ata_device *dev;
 
-       ata_link_for_each_dev(dev, link) {
-               if (ata_dev_enabled(dev)) {
-                       /* We don't really care */
-                       dev->pio_mode = XFER_PIO_0;
-                       dev->xfer_mode = XFER_PIO_0;
-                       dev->xfer_shift = ATA_SHIFT_PIO;
-                       dev->flags |= ATA_DFLAG_PIO;
-                       ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
-               }
+       ata_for_each_dev(dev, link, ENABLED) {
+               /* We don't really care */
+               dev->pio_mode = XFER_PIO_0;
+               dev->xfer_mode = XFER_PIO_0;
+               dev->xfer_shift = ATA_SHIFT_PIO;
+               dev->flags |= ATA_DFLAG_PIO;
+               ata_dev_printk(dev, KERN_INFO, "configured for PIO\n");
        }
        return 0;
 }
@@ -87,19 +85,17 @@ static int rz1000_fifo_disable(struct pci_dev *pdev)
 
 static int rz1000_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       static int printed_version;
        static const struct ata_port_info info = {
                .flags = ATA_FLAG_SLAVE_POSS,
-               .pio_mask = 0x1f,
+               .pio_mask = ATA_PIO4,
                .port_ops = &rz1000_port_ops
        };
        const struct ata_port_info *ppi[] = { &info, NULL };
 
-       if (!printed_version++)
-               printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
+       printk_once(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
 
        if (rz1000_fifo_disable(pdev) == 0)
-               return ata_pci_sff_init_one(pdev, ppi, &rz1000_sht, NULL);
+               return ata_pci_sff_init_one(pdev, ppi, &rz1000_sht, NULL, 0);
 
        printk(KERN_ERR DRV_NAME ": failed to disable read-ahead on chipset..\n");
        /* Not safe to use so skip */
@@ -109,11 +105,20 @@ static int rz1000_init_one (struct pci_dev *pdev, const struct pci_device_id *en
 #ifdef CONFIG_PM
 static int rz1000_reinit_one(struct pci_dev *pdev)
 {
+       struct ata_host *host = dev_get_drvdata(&pdev->dev);
+       int rc;
+
+       rc = ata_pci_device_do_resume(pdev);
+       if (rc)
+               return rc;
+
        /* If this fails on resume (which is a "cant happen" case), we
           must stop as any progress risks data loss */
        if (rz1000_fifo_disable(pdev))
                panic("rz1000 fifo");
-       return ata_pci_device_resume(pdev);
+
+       ata_host_resume(host);
+       return 0;
 }
 #endif