diff options
author | Tejun Heo <htejun@gmail.com> | 2007-05-14 14:28:16 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-09 12:17:31 -0400 |
commit | 69b16a5f4c4f1dab70d4d555c487c318c6878b3e (patch) | |
tree | 658604c9f846cdf0f8a158f1ee29a7e96c22ccfe /drivers | |
parent | 4700c4bc9262a9e78f7197c4c41cc2be085d5276 (diff) |
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: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-acpi.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 4d36d254730b..ae2077e1e78f 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -175,21 +175,17 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
175 | 175 | ||
176 | out_obj = output.pointer; | 176 | out_obj = output.pointer; |
177 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 177 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
178 | if (ata_msg_probe(ap)) | 178 | ata_dev_printk(dev, KERN_WARNING, |
179 | ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: " | 179 | "_GTF unexpected object type 0x%x\n", |
180 | "error: expected object type of " | 180 | out_obj->type); |
181 | " ACPI_TYPE_BUFFER, got 0x%x\n", | ||
182 | __FUNCTION__, out_obj->type); | ||
183 | rc = -EINVAL; | 181 | rc = -EINVAL; |
184 | goto out_free; | 182 | goto out_free; |
185 | } | 183 | } |
186 | 184 | ||
187 | if (out_obj->buffer.length % REGS_PER_GTF) { | 185 | if (out_obj->buffer.length % REGS_PER_GTF) { |
188 | if (ata_msg_drv(ap)) | 186 | ata_dev_printk(dev, KERN_WARNING, |
189 | ata_dev_printk(dev, KERN_ERR, | 187 | "unexpected _GTF length (%d)\n", |
190 | "%s: unexpected GTF length (%d) or addr (0x%p)\n", | 188 | out_obj->buffer.length); |
191 | __FUNCTION__, out_obj->buffer.length, | ||
192 | out_obj->buffer.pointer); | ||
193 | rc = -EINVAL; | 189 | rc = -EINVAL; |
194 | goto out_free; | 190 | goto out_free; |
195 | } | 191 | } |
@@ -320,6 +316,12 @@ static int ata_dev_set_taskfiles(struct ata_device *dev, | |||
320 | * @ap: the ata_port for the drive | 316 | * @ap: the ata_port for the drive |
321 | * | 317 | * |
322 | * This applies to both PATA and SATA drives. | 318 | * This applies to both PATA and SATA drives. |
319 | * | ||
320 | * LOCKING: | ||
321 | * EH context. | ||
322 | * | ||
323 | * RETURNS: | ||
324 | * 0 on success, -errno on failure. | ||
323 | */ | 325 | */ |
324 | int ata_acpi_exec_tfs(struct ata_port *ap) | 326 | int ata_acpi_exec_tfs(struct ata_port *ap) |
325 | { | 327 | { |
@@ -345,24 +347,14 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
345 | ret = ata_dev_get_GTF(dev, >f, &ptr_to_free); | 347 | ret = ata_dev_get_GTF(dev, >f, &ptr_to_free); |
346 | if (ret == 0) | 348 | if (ret == 0) |
347 | continue; | 349 | continue; |
348 | if (ret < 0) { | 350 | if (ret < 0) |
349 | if (ata_msg_probe(ap)) | ||
350 | ata_port_printk(ap, KERN_DEBUG, | ||
351 | "%s: get_GTF error (%d)\n", | ||
352 | __FUNCTION__, ret); | ||
353 | break; | 351 | break; |
354 | } | ||
355 | gtf_count = ret; | 352 | gtf_count = ret; |
356 | 353 | ||
357 | ret = ata_dev_set_taskfiles(dev, gtf, gtf_count); | 354 | ret = ata_dev_set_taskfiles(dev, gtf, gtf_count); |
358 | kfree(ptr_to_free); | 355 | kfree(ptr_to_free); |
359 | if (ret < 0) { | 356 | if (ret < 0) |
360 | if (ata_msg_probe(ap)) | ||
361 | ata_port_printk(ap, KERN_DEBUG, | ||
362 | "%s: set_taskfiles error (%d)\n", | ||
363 | __FUNCTION__, ret); | ||
364 | break; | 357 | break; |
365 | } | ||
366 | } | 358 | } |
367 | 359 | ||
368 | return ret; | 360 | return ret; |
@@ -377,6 +369,12 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
377 | * ATM this function never returns a failure. It is an optional | 369 | * ATM this function never returns a failure. It is an optional |
378 | * method and if it fails for whatever reason, we should still | 370 | * method and if it fails for whatever reason, we should still |
379 | * just keep going. | 371 | * just keep going. |
372 | * | ||
373 | * LOCKING: | ||
374 | * EH context. | ||
375 | * | ||
376 | * RETURNS: | ||
377 | * 0 on success, -errno on failure. | ||
380 | */ | 378 | */ |
381 | int ata_acpi_push_id(struct ata_device *dev) | 379 | int ata_acpi_push_id(struct ata_device *dev) |
382 | { | 380 | { |
@@ -416,12 +414,9 @@ int ata_acpi_push_id(struct ata_device *dev) | |||
416 | swap_buf_le16(dev->id, ATA_ID_WORDS); | 414 | swap_buf_le16(dev->id, ATA_ID_WORDS); |
417 | 415 | ||
418 | err = ACPI_FAILURE(status) ? -EIO : 0; | 416 | err = ACPI_FAILURE(status) ? -EIO : 0; |
419 | if (err < 0) { | 417 | if (err < 0) |
420 | if (ata_msg_probe(ap)) | 418 | ata_dev_printk(dev, KERN_WARNING, |
421 | ata_dev_printk(dev, KERN_DEBUG, | 419 | "ACPI _SDD failed (AE 0x%x)\n", status); |
422 | "%s _SDD error: status = 0x%x\n", | ||
423 | __FUNCTION__, status); | ||
424 | } | ||
425 | 420 | ||
426 | /* always return success */ | 421 | /* always return success */ |
427 | out: | 422 | out: |