[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>
This commit is contained in:
Родитель
d63cb4a636
Коммит
5eb45c02a9
|
@ -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);
|
rc = ata_dev_revalidate(ap, dev, 0);
|
||||||
if (rc) {
|
if (rc)
|
||||||
printk(KERN_ERR
|
|
||||||
"ata%u: failed to revalidate after set xfermode\n",
|
|
||||||
ap->id);
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
|
||||||
|
|
||||||
DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
|
DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
|
||||||
dev->xfer_shift, (int)dev->xfer_mode);
|
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 ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev,
|
||||||
int post_reset)
|
int post_reset)
|
||||||
{
|
{
|
||||||
unsigned int class;
|
unsigned int class = dev->class;
|
||||||
u16 *id;
|
u16 *id = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (!ata_dev_enabled(dev))
|
if (!ata_dev_enabled(dev)) {
|
||||||
return -ENODEV;
|
rc = -ENODEV;
|
||||||
|
goto fail;
|
||||||
class = dev->class;
|
}
|
||||||
id = NULL;
|
|
||||||
|
|
||||||
/* allocate & read ID data */
|
/* allocate & read ID data */
|
||||||
rc = ata_dev_read_id(ap, dev, &class, post_reset, &id);
|
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;
|
dev->id = id;
|
||||||
|
|
||||||
/* configure device according to the new 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:
|
fail:
|
||||||
printk(KERN_ERR "ata%u: dev %u revalidation failed (errno=%d)\n",
|
printk(KERN_ERR "ata%u: dev %u revalidation failed (errno=%d)\n",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче