[PATCH] libata: implement ata_dev_disable()
authorTejun Heo <htejun@gmail.com>
Fri, 24 Mar 2006 06:25:31 +0000 (15:25 +0900)
committerJeff Garzik <jeff@garzik.org>
Fri, 24 Mar 2006 14:39:57 +0000 (09:39 -0500)
This patch implements ata_dev_disable() which prints a warning message
and takes @dev offline.  Currently, this is done by explicitly
incrementing dev->class with case-by-case warning messages.  Giving
user clear indication when libata gives up will be more important as
libata will be doing more retries.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/scsi/libata-core.c

index 9cd9053..d1530b9 100644 (file)
@@ -394,6 +394,15 @@ static const char *ata_mode_string(unsigned int xfer_mask)
        return "<n/a>";
 }
 
+static void ata_dev_disable(struct ata_port *ap, struct ata_device *dev)
+{
+       if (ata_dev_present(dev)) {
+               printk(KERN_WARNING "ata%u: dev %u disabled\n",
+                      ap->id, dev->devno);
+               dev->class++;
+       }
+}
+
 /**
  *     ata_pio_devchk - PATA device presence detection
  *     @ap: ATA channel to examine