aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-acpi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-24 18:22:42 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-24 18:22:42 -0400
commit1f5892a5d21c905b1614cbd6bd8c5ad2cfbc106f (patch)
tree6a0a18dc234956eb38168ccb62284b452cce4fd0 /drivers/ide/ide-acpi.c
parent2f0d0fd2a605666d38e290c5c0d2907484352dc4 (diff)
ide-acpi: cleanup do_drive_set_taskfiles()
* ide_noacpi is already checked by ide_acpi_exec_tfs() which is the only user of do_drive_set_taskfiles(). * ide_acpi_exec_tfs() prints sufficient debug info about the device so no need to do it again. * do_drive_get_GTF() + ide_acpi_exec_tfs() make sure that this function will never be called with incorrect gtf_length argument or if device is not present. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-acpi.c')
-rw-r--r--drivers/ide/ide-acpi.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index 6b3123612f1c..ce5b213e2bc2 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -334,32 +334,14 @@ static int do_drive_set_taskfiles(ide_drive_t *drive,
334 unsigned int gtf_length, 334 unsigned int gtf_length,
335 unsigned long gtf_address) 335 unsigned long gtf_address)
336{ 336{
337 int rc = -ENODEV, err; 337 int rc = 0, err;
338 int gtf_count = gtf_length / REGS_PER_GTF; 338 int gtf_count = gtf_length / REGS_PER_GTF;
339 int ix; 339 int ix;
340 struct taskfile_array *gtf; 340 struct taskfile_array *gtf;
341 341
342 if (ide_noacpi)
343 return 0;
344
345 DEBPRINT("ENTER: %s, hard_port#: %d\n", drive->name, drive->dn);
346
347 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
348 goto out;
349
350 if (!gtf_count) /* shouldn't be here */
351 goto out;
352
353 DEBPRINT("total GTF bytes=%u (0x%x), gtf_count=%d, addr=0x%lx\n", 342 DEBPRINT("total GTF bytes=%u (0x%x), gtf_count=%d, addr=0x%lx\n",
354 gtf_length, gtf_length, gtf_count, gtf_address); 343 gtf_length, gtf_length, gtf_count, gtf_address);
355 344
356 if (gtf_length % REGS_PER_GTF) {
357 printk(KERN_ERR "%s: unexpected GTF length (%d)\n",
358 __func__, gtf_length);
359 goto out;
360 }
361
362 rc = 0;
363 for (ix = 0; ix < gtf_count; ix++) { 345 for (ix = 0; ix < gtf_count; ix++) {
364 gtf = (struct taskfile_array *) 346 gtf = (struct taskfile_array *)
365 (gtf_address + ix * REGS_PER_GTF); 347 (gtf_address + ix * REGS_PER_GTF);
@@ -370,7 +352,6 @@ static int do_drive_set_taskfiles(ide_drive_t *drive,
370 rc = err; 352 rc = err;
371 } 353 }
372 354
373out:
374 return rc; 355 return rc;
375} 356}
376 357