diff options
author | Tejun Heo <htejun@gmail.com> | 2006-03-31 11:38:18 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-01 12:33:46 -0500 |
commit | 4f65977df0b9a667fdcd85b95d457a220c94113f (patch) | |
tree | b7cccdf707088b2f5c07c01c26b7761ef92ed175 /drivers/scsi/libata-core.c | |
parent | e1211e3fa7fd05ff0d4f597fd37e40de8acc6784 (diff) |
[PATCH] libata: make ata_set_mode() handle no-device case properly
Make ata_set_mode() return without doing anything if there is no
device on the port. This is in preparation for ata_bus_probe()
changes.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index c10c550da38b..913e378eca7f 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1823,7 +1823,7 @@ static void ata_host_set_dma(struct ata_port *ap) | |||
1823 | */ | 1823 | */ |
1824 | static void ata_set_mode(struct ata_port *ap) | 1824 | static void ata_set_mode(struct ata_port *ap) |
1825 | { | 1825 | { |
1826 | int i, rc, used_dma = 0; | 1826 | int i, rc, used_dma = 0, found = 0; |
1827 | 1827 | ||
1828 | /* step 1: calculate xfer_mask */ | 1828 | /* step 1: calculate xfer_mask */ |
1829 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 1829 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
@@ -1842,9 +1842,12 @@ static void ata_set_mode(struct ata_port *ap) | |||
1842 | dev->pio_mode = ata_xfer_mask2mode(pio_mask); | 1842 | dev->pio_mode = ata_xfer_mask2mode(pio_mask); |
1843 | dev->dma_mode = ata_xfer_mask2mode(dma_mask); | 1843 | dev->dma_mode = ata_xfer_mask2mode(dma_mask); |
1844 | 1844 | ||
1845 | found = 1; | ||
1845 | if (dev->dma_mode) | 1846 | if (dev->dma_mode) |
1846 | used_dma = 1; | 1847 | used_dma = 1; |
1847 | } | 1848 | } |
1849 | if (!found) | ||
1850 | return; | ||
1848 | 1851 | ||
1849 | /* step 2: always set host PIO timings */ | 1852 | /* step 2: always set host PIO timings */ |
1850 | rc = ata_host_set_pio(ap); | 1853 | rc = ata_host_set_pio(ap); |