diff options
Diffstat (limited to 'drivers/ata/sata_sil.c')
-rw-r--r-- | drivers/ata/sata_sil.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index 2ddbe4cc71e4..4c9295a49a49 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -303,22 +303,20 @@ static int sil_set_mode (struct ata_port *ap, struct ata_device **r_failed) | |||
303 | struct ata_device *dev; | 303 | struct ata_device *dev; |
304 | void __iomem *mmio_base = host->iomap[SIL_MMIO_BAR]; | 304 | void __iomem *mmio_base = host->iomap[SIL_MMIO_BAR]; |
305 | void __iomem *addr = mmio_base + sil_port[ap->port_no].xfer_mode; | 305 | void __iomem *addr = mmio_base + sil_port[ap->port_no].xfer_mode; |
306 | u32 tmp, dev_mode[2]; | 306 | u32 tmp, dev_mode[2] = { }; |
307 | unsigned int i; | ||
308 | int rc; | 307 | int rc; |
309 | 308 | ||
310 | rc = ata_do_set_mode(ap, r_failed); | 309 | rc = ata_do_set_mode(ap, r_failed); |
311 | if (rc) | 310 | if (rc) |
312 | return rc; | 311 | return rc; |
313 | 312 | ||
314 | for (i = 0; i < 2; i++) { | 313 | ata_link_for_each_dev(dev, &ap->link) { |
315 | dev = &ap->link.device[i]; | ||
316 | if (!ata_dev_enabled(dev)) | 314 | if (!ata_dev_enabled(dev)) |
317 | dev_mode[i] = 0; /* PIO0/1/2 */ | 315 | dev_mode[dev->devno] = 0; /* PIO0/1/2 */ |
318 | else if (dev->flags & ATA_DFLAG_PIO) | 316 | else if (dev->flags & ATA_DFLAG_PIO) |
319 | dev_mode[i] = 1; /* PIO3/4 */ | 317 | dev_mode[dev->devno] = 1; /* PIO3/4 */ |
320 | else | 318 | else |
321 | dev_mode[i] = 3; /* UDMA */ | 319 | dev_mode[dev->devno] = 3; /* UDMA */ |
322 | /* value 2 indicates MDMA */ | 320 | /* value 2 indicates MDMA */ |
323 | } | 321 | } |
324 | 322 | ||