aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-31 11:38:18 -0500
committerJeff Garzik <jeff@garzik.org>2006-04-01 12:33:45 -0500
commite1211e3fa7fd05ff0d4f597fd37e40de8acc6784 (patch)
tree672018d7facf99ad4d45b09e2e2980accebdfe38 /drivers/scsi/libata-core.c
parent9974e7cc6c8b8ea796c92cdf28db93e4579a4000 (diff)
[PATCH] libata: implement ata_dev_enabled and disabled()
This patch renames ata_dev_present() to ata_dev_enabled() and adds ata_dev_disabled(). This is to discern the state where a device is present but disabled from not-present state. This disctinction is necessary when configuring transfer mode because device selection timing must not be violated even if a device fails to configure. 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.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 559abe4ea4e9..c10c550da38b 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -411,7 +411,7 @@ static const char *sata_spd_string(unsigned int spd)
411 411
412static void ata_dev_disable(struct ata_port *ap, struct ata_device *dev) 412static void ata_dev_disable(struct ata_port *ap, struct ata_device *dev)
413{ 413{
414 if (ata_dev_present(dev)) { 414 if (ata_dev_enabled(dev)) {
415 printk(KERN_WARNING "ata%u: dev %u disabled\n", 415 printk(KERN_WARNING "ata%u: dev %u disabled\n",
416 ap->id, dev->devno); 416 ap->id, dev->devno);
417 dev->class++; 417 dev->class++;
@@ -1222,7 +1222,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev,
1222 unsigned int xfer_mask; 1222 unsigned int xfer_mask;
1223 int i, rc; 1223 int i, rc;
1224 1224
1225 if (!ata_dev_present(dev)) { 1225 if (!ata_dev_enabled(dev)) {
1226 DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n", 1226 DPRINTK("ENTER/EXIT (host %u, dev %u) -- nodev\n",
1227 ap->id, dev->devno); 1227 ap->id, dev->devno);
1228 return 0; 1228 return 0;
@@ -1401,7 +1401,7 @@ static int ata_bus_probe(struct ata_port *ap)
1401 1401
1402 dev->class = classes[i]; 1402 dev->class = classes[i];
1403 1403
1404 if (!ata_dev_present(dev)) 1404 if (!ata_dev_enabled(dev))
1405 continue; 1405 continue;
1406 1406
1407 WARN_ON(dev->id != NULL); 1407 WARN_ON(dev->id != NULL);
@@ -1565,7 +1565,7 @@ void sata_phy_reset(struct ata_port *ap)
1565struct ata_device *ata_dev_pair(struct ata_port *ap, struct ata_device *adev) 1565struct ata_device *ata_dev_pair(struct ata_port *ap, struct ata_device *adev)
1566{ 1566{
1567 struct ata_device *pair = &ap->device[1 - adev->devno]; 1567 struct ata_device *pair = &ap->device[1 - adev->devno];
1568 if (!ata_dev_present(pair)) 1568 if (!ata_dev_enabled(pair))
1569 return NULL; 1569 return NULL;
1570 return pair; 1570 return pair;
1571} 1571}
@@ -1778,7 +1778,7 @@ static int ata_host_set_pio(struct ata_port *ap)
1778 for (i = 0; i < ATA_MAX_DEVICES; i++) { 1778 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1779 struct ata_device *dev = &ap->device[i]; 1779 struct ata_device *dev = &ap->device[i];
1780 1780
1781 if (!ata_dev_present(dev)) 1781 if (!ata_dev_enabled(dev))
1782 continue; 1782 continue;
1783 1783
1784 if (!dev->pio_mode) { 1784 if (!dev->pio_mode) {
@@ -1802,7 +1802,7 @@ static void ata_host_set_dma(struct ata_port *ap)
1802 for (i = 0; i < ATA_MAX_DEVICES; i++) { 1802 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1803 struct ata_device *dev = &ap->device[i]; 1803 struct ata_device *dev = &ap->device[i];
1804 1804
1805 if (!ata_dev_present(dev) || !dev->dma_mode) 1805 if (!ata_dev_enabled(dev) || !dev->dma_mode)
1806 continue; 1806 continue;
1807 1807
1808 dev->xfer_mode = dev->dma_mode; 1808 dev->xfer_mode = dev->dma_mode;
@@ -1830,7 +1830,7 @@ static void ata_set_mode(struct ata_port *ap)
1830 struct ata_device *dev = &ap->device[i]; 1830 struct ata_device *dev = &ap->device[i];
1831 unsigned int pio_mask, dma_mask; 1831 unsigned int pio_mask, dma_mask;
1832 1832
1833 if (!ata_dev_present(dev)) 1833 if (!ata_dev_enabled(dev))
1834 continue; 1834 continue;
1835 1835
1836 ata_dev_xfermask(ap, dev); 1836 ata_dev_xfermask(ap, dev);
@@ -1858,7 +1858,7 @@ static void ata_set_mode(struct ata_port *ap)
1858 for (i = 0; i < ATA_MAX_DEVICES; i++) { 1858 for (i = 0; i < ATA_MAX_DEVICES; i++) {
1859 struct ata_device *dev = &ap->device[i]; 1859 struct ata_device *dev = &ap->device[i];
1860 1860
1861 if (!ata_dev_present(dev)) 1861 if (!ata_dev_enabled(dev))
1862 continue; 1862 continue;
1863 1863
1864 rc = ata_dev_set_mode(ap, dev); 1864 rc = ata_dev_set_mode(ap, dev);
@@ -2550,7 +2550,7 @@ int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
2550 u16 *id; 2550 u16 *id;
2551 int rc; 2551 int rc;
2552 2552
2553 if (!ata_dev_present(dev)) 2553 if (!ata_dev_enabled(dev))
2554 return -ENODEV; 2554 return -ENODEV;
2555 2555
2556 class = dev->class; 2556 class = dev->class;
@@ -2679,7 +2679,7 @@ static void ata_dev_xfermask(struct ata_port *ap, struct ata_device *dev)
2679 /* FIXME: Use port-wide xfermask for now */ 2679 /* FIXME: Use port-wide xfermask for now */
2680 for (i = 0; i < ATA_MAX_DEVICES; i++) { 2680 for (i = 0; i < ATA_MAX_DEVICES; i++) {
2681 struct ata_device *d = &ap->device[i]; 2681 struct ata_device *d = &ap->device[i];
2682 if (!ata_dev_present(d)) 2682 if (!ata_dev_enabled(d))
2683 continue; 2683 continue;
2684 xfer_mask &= ata_pack_xfermask(d->pio_mask, d->mwdma_mask, 2684 xfer_mask &= ata_pack_xfermask(d->pio_mask, d->mwdma_mask,
2685 d->udma_mask); 2685 d->udma_mask);
@@ -4299,7 +4299,7 @@ int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
4299 ap->flags &= ~ATA_FLAG_SUSPENDED; 4299 ap->flags &= ~ATA_FLAG_SUSPENDED;
4300 ata_set_mode(ap); 4300 ata_set_mode(ap);
4301 } 4301 }
4302 if (!ata_dev_present(dev)) 4302 if (!ata_dev_enabled(dev))
4303 return 0; 4303 return 0;
4304 if (dev->class == ATA_DEV_ATA) 4304 if (dev->class == ATA_DEV_ATA)
4305 ata_start_drive(ap, dev); 4305 ata_start_drive(ap, dev);
@@ -4317,7 +4317,7 @@ int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
4317 */ 4317 */
4318int ata_device_suspend(struct ata_port *ap, struct ata_device *dev, pm_message_t state) 4318int ata_device_suspend(struct ata_port *ap, struct ata_device *dev, pm_message_t state)
4319{ 4319{
4320 if (!ata_dev_present(dev)) 4320 if (!ata_dev_enabled(dev))
4321 return 0; 4321 return 0;
4322 if (dev->class == ATA_DEV_ATA) 4322 if (dev->class == ATA_DEV_ATA)
4323 ata_flush_cache(ap, dev); 4323 ata_flush_cache(ap, dev);