aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-02 18:51:52 +0900
committerJeff Garzik <jeff@garzik.org>2006-04-02 10:09:19 -0400
commit5eb45c02a9944e813a0b82457607557a1f2c64b5 (patch)
tree32a874e2c41ceaa541ef6a30d8d3faf4be2127ad /drivers/scsi
parentd63cb4a6365aa161341fc365df1edc87cd00c9c0 (diff)
[PATCH] libata: ata_dev_revalidate() printk update
Make sure ata_dev_revalidate() complains on failures and kill revalidation failure message printed from ata_dev_set_mode(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libata-core.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 15d6c24c8e5..f39352a3ac1 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1961,12 +1961,8 @@ static int ata_dev_set_mode(struct ata_port *ap, struct ata_device *dev)
}
rc = ata_dev_revalidate(ap, dev, 0);
- if (rc) {
- printk(KERN_ERR
- "ata%u: failed to revalidate after set xfermode\n",
- ap->id);
+ if (rc)
return rc;
- }
DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
dev->xfer_shift, (int)dev->xfer_mode);
@@ -2786,15 +2782,14 @@ static int ata_dev_same_device(struct ata_port *ap, struct ata_device *dev,
int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
int post_reset)
{
- unsigned int class;
- u16 *id;
+ unsigned int class = dev->class;
+ u16 *id = NULL;
int rc;
- if (!ata_dev_enabled(dev))
- return -ENODEV;
-
- class = dev->class;
- id = NULL;
+ if (!ata_dev_enabled(dev)) {
+ rc = -ENODEV;
+ goto fail;
+ }
/* allocate & read ID data */
rc = ata_dev_read_id(ap, dev, &class, post_reset, &id);
@@ -2811,7 +2806,9 @@ int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
dev->id = id;
/* configure device according to the new ID */
- return ata_dev_configure(ap, dev, 0);
+ rc = ata_dev_configure(ap, dev, 0);
+ if (rc == 0)
+ return 0;
fail:
printk(KERN_ERR "ata%u: dev %u revalidation failed (errno=%d)\n",