From: Tejun Heo Date: Sun, 18 May 2008 16:15:05 +0000 (+0900) Subject: libata: fix sata_link_hardreset() @online out parameter handling X-Git-Tag: MMI-PSA29.97-13-9~34240^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0cbf0711a1ebcc4d3aea8e11def684afc2c07ef8;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git libata: fix sata_link_hardreset() @online out parameter handling The @online out parameter is supposed to set to true iff link is online and reset succeeded as advertised in the function description and callers are coded expecting that. However, sata_link_reset() didn't behave this way on device readiness test failure. Fix it. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 927b692d723c..c6c316fc8379 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3653,9 +3653,13 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing, if (check_ready) rc = ata_wait_ready(link, deadline, check_ready); out: - if (rc && rc != -EAGAIN) + if (rc && rc != -EAGAIN) { + /* online is set iff link is online && reset succeeded */ + if (online) + *online = false; ata_link_printk(link, KERN_ERR, "COMRESET failed (errno=%d)\n", rc); + } DPRINTK("EXIT, rc=%d\n", rc); return rc; }