Commit 69b16a5f authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata-acpi: miscellaneous cleanups

* Add missing LOCKING: and RETURNS: to function comment.

* Don't conditionalize warning messages with ata_msg_probe().  Print
  directly with KERN_WARNING.

* Drop duplicate debug messages.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 4700c4bc
...@@ -175,21 +175,17 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, ...@@ -175,21 +175,17 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
out_obj = output.pointer; out_obj = output.pointer;
if (out_obj->type != ACPI_TYPE_BUFFER) { if (out_obj->type != ACPI_TYPE_BUFFER) {
if (ata_msg_probe(ap)) ata_dev_printk(dev, KERN_WARNING,
ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: " "_GTF unexpected object type 0x%x\n",
"error: expected object type of " out_obj->type);
" ACPI_TYPE_BUFFER, got 0x%x\n",
__FUNCTION__, out_obj->type);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
if (out_obj->buffer.length % REGS_PER_GTF) { if (out_obj->buffer.length % REGS_PER_GTF) {
if (ata_msg_drv(ap)) ata_dev_printk(dev, KERN_WARNING,
ata_dev_printk(dev, KERN_ERR, "unexpected _GTF length (%d)\n",
"%s: unexpected GTF length (%d) or addr (0x%p)\n", out_obj->buffer.length);
__FUNCTION__, out_obj->buffer.length,
out_obj->buffer.pointer);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -320,6 +316,12 @@ static int ata_dev_set_taskfiles(struct ata_device *dev, ...@@ -320,6 +316,12 @@ static int ata_dev_set_taskfiles(struct ata_device *dev,
* @ap: the ata_port for the drive * @ap: the ata_port for the drive
* *
* This applies to both PATA and SATA drives. * This applies to both PATA and SATA drives.
*
* LOCKING:
* EH context.
*
* RETURNS:
* 0 on success, -errno on failure.
*/ */
int ata_acpi_exec_tfs(struct ata_port *ap) int ata_acpi_exec_tfs(struct ata_port *ap)
{ {
...@@ -345,25 +347,15 @@ int ata_acpi_exec_tfs(struct ata_port *ap) ...@@ -345,25 +347,15 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
ret = ata_dev_get_GTF(dev, &gtf, &ptr_to_free); ret = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);
if (ret == 0) if (ret == 0)
continue; continue;
if (ret < 0) { if (ret < 0)
if (ata_msg_probe(ap))
ata_port_printk(ap, KERN_DEBUG,
"%s: get_GTF error (%d)\n",
__FUNCTION__, ret);
break; break;
}
gtf_count = ret; gtf_count = ret;
ret = ata_dev_set_taskfiles(dev, gtf, gtf_count); ret = ata_dev_set_taskfiles(dev, gtf, gtf_count);
kfree(ptr_to_free); kfree(ptr_to_free);
if (ret < 0) { if (ret < 0)
if (ata_msg_probe(ap))
ata_port_printk(ap, KERN_DEBUG,
"%s: set_taskfiles error (%d)\n",
__FUNCTION__, ret);
break; break;
} }
}
return ret; return ret;
} }
...@@ -377,6 +369,12 @@ int ata_acpi_exec_tfs(struct ata_port *ap) ...@@ -377,6 +369,12 @@ int ata_acpi_exec_tfs(struct ata_port *ap)
* ATM this function never returns a failure. It is an optional * ATM this function never returns a failure. It is an optional
* method and if it fails for whatever reason, we should still * method and if it fails for whatever reason, we should still
* just keep going. * just keep going.
*
* LOCKING:
* EH context.
*
* RETURNS:
* 0 on success, -errno on failure.
*/ */
int ata_acpi_push_id(struct ata_device *dev) int ata_acpi_push_id(struct ata_device *dev)
{ {
...@@ -416,12 +414,9 @@ int ata_acpi_push_id(struct ata_device *dev) ...@@ -416,12 +414,9 @@ int ata_acpi_push_id(struct ata_device *dev)
swap_buf_le16(dev->id, ATA_ID_WORDS); swap_buf_le16(dev->id, ATA_ID_WORDS);
err = ACPI_FAILURE(status) ? -EIO : 0; err = ACPI_FAILURE(status) ? -EIO : 0;
if (err < 0) { if (err < 0)
if (ata_msg_probe(ap)) ata_dev_printk(dev, KERN_WARNING,
ata_dev_printk(dev, KERN_DEBUG, "ACPI _SDD failed (AE 0x%x)\n", status);
"%s _SDD error: status = 0x%x\n",
__FUNCTION__, status);
}
/* always return success */ /* always return success */
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment