]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - drivers/ata/pata_pdc2027x.c
libata-link: implement and use link/device iterators
[mirror_ubuntu-focal-kernel.git] / drivers / ata / pata_pdc2027x.c
index e3245b36269a2cd64257a228c131b68c683ba1cd..83c90cabc7ff3b6114f200d630f3c7ad92005e31 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_pdc2027x"
-#define DRV_VERSION    "0.9"
+#define DRV_VERSION    "1.0"
 #undef PDC_DEBUG
 
 #ifdef PDC_DEBUG
@@ -479,15 +479,14 @@ static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  */
 static int pdc2027x_set_mode(struct ata_port *ap, struct ata_device **r_failed)
 {
-       int i;
-
-       i = ata_do_set_mode(ap, r_failed);
-       if (i < 0)
-               return i;
+       struct ata_device *dev;
+       int rc;
 
-       for (i = 0; i < ATA_MAX_DEVICES; i++) {
-               struct ata_device *dev = &ap->device[i];
+       rc = ata_do_set_mode(ap, r_failed);
+       if (rc < 0)
+               return rc;
 
+       ata_link_for_each_dev(dev, &ap->link) {
                if (ata_dev_enabled(dev)) {
 
                        pdc2027x_set_piomode(ap, dev);