aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-acpi.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 08a52dd45fb6..545ea865ceb5 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
312 * 312 *
313 * RETURNS: 313 * RETURNS:
314 * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't 314 * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't
315 * contain valid data. -errno on other errors. 315 * contain valid data.
316 */ 316 */
317static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, 317static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
318 void **ptr_to_free) 318 void **ptr_to_free)
@@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
339 ata_dev_printk(dev, KERN_WARNING, 339 ata_dev_printk(dev, KERN_WARNING,
340 "_GTF evaluation failed (AE 0x%x)\n", 340 "_GTF evaluation failed (AE 0x%x)\n",
341 status); 341 status);
342 rc = -EIO;
343 } 342 }
344 goto out_free; 343 goto out_free;
345 } 344 }
@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
359 ata_dev_printk(dev, KERN_WARNING, 358 ata_dev_printk(dev, KERN_WARNING,
360 "_GTF unexpected object type 0x%x\n", 359 "_GTF unexpected object type 0x%x\n",
361 out_obj->type); 360 out_obj->type);
362 rc = -EINVAL;
363 goto out_free; 361 goto out_free;
364 } 362 }
365 363
@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
367 ata_dev_printk(dev, KERN_WARNING, 365 ata_dev_printk(dev, KERN_WARNING,
368 "unexpected _GTF length (%d)\n", 366 "unexpected _GTF length (%d)\n",
369 out_obj->buffer.length); 367 out_obj->buffer.length);
370 rc = -EINVAL;
371 goto out_free; 368 goto out_free;
372 } 369 }
373 370
@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
511 int gtf_count, i, rc; 508 int gtf_count, i, rc;
512 509
513 /* get taskfiles */ 510 /* get taskfiles */
514 rc = ata_dev_get_GTF(dev, &gtf, &ptr_to_free); 511 gtf_count = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);
515 if (rc < 0)
516 return rc;
517 gtf_count = rc;
518 512
519 /* execute them */ 513 /* execute them */
520 for (i = 0, rc = 0; i < gtf_count; i++) { 514 for (i = 0, rc = 0; i < gtf_count; i++) {