aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it821x.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:03 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:03 -0500
commitf01393e48c44e30f7c9a36c8b98a07b0232580fe (patch)
treed585310ef7ee6509285a96b849af2e544e5fea25 /drivers/ide/pci/it821x.c
parent6dd9b8376adbee95ddc321cc83c7f641577e01f6 (diff)
ide: merge ->fixup and ->quirkproc methods
* Assign drive->quirk_list in ->quirkproc implementations: - hpt366.c::hpt3xx_quirkproc() - pdc202xx_new.c::pdcnew_quirkproc() - pdc202xx_old.c::pdc202xx_quirkproc() * Make ->quirkproc void. * Move calling ->quirkproc from do_identify() to probe_hwif(). * Convert it821x_fixups() to it821x_quirkproc() in it821x.c. * Convert siimage_fixup() to sil_quirkproc() in siimage.c, also remove no longer needed drive->present check from is_dev_seagate_sata(). * Convert ide_undecoded_slave() to accept 'drive' instead of 'hwif' as an argument. Then convert ide_register_hw() to accept 'quirkproc' argument instead of 'fixup' one. * Remove no longer needed ->fixup method. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/it821x.c')
-rw-r--r--drivers/ide/pci/it821x.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 99b7d763b6c7..e610a5340fdc 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -431,33 +431,29 @@ static u8 __devinit ata66_it821x(ide_hwif_t *hwif)
431} 431}
432 432
433/** 433/**
434 * it821x_fixup - post init callback 434 * it821x_quirkproc - post init callback
435 * @hwif: interface 435 * @drive: drive
436 * 436 *
437 * This callback is run after the drives have been probed but 437 * This callback is run after the drive has been probed but
438 * before anything gets attached. It allows drivers to do any 438 * before anything gets attached. It allows drivers to do any
439 * final tuning that is needed, or fixups to work around bugs. 439 * final tuning that is needed, or fixups to work around bugs.
440 */ 440 */
441 441
442static void __devinit it821x_fixups(ide_hwif_t *hwif) 442static void __devinit it821x_quirkproc(ide_drive_t *drive)
443{ 443{
444 struct it821x_dev *itdev = ide_get_hwifdata(hwif); 444 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif);
445 int i; 445 struct hd_driveid *id = drive->id;
446 u16 *idbits = (u16 *)drive->id;
446 447
447 if(!itdev->smart) { 448 if (!itdev->smart) {
448 /* 449 /*
449 * If we are in pass through mode then not much 450 * If we are in pass through mode then not much
450 * needs to be done, but we do bother to clear the 451 * needs to be done, but we do bother to clear the
451 * IRQ mask as we may well be in PIO (eg rev 0x10) 452 * IRQ mask as we may well be in PIO (eg rev 0x10)
452 * for now and we know unmasking is safe on this chipset. 453 * for now and we know unmasking is safe on this chipset.
453 */ 454 */
454 for (i = 0; i < 2; i++) { 455 drive->unmask = 1;
455 ide_drive_t *drive = &hwif->drives[i]; 456 } else {
456 if(drive->present)
457 drive->unmask = 1;
458 }
459 return;
460 }
461 /* 457 /*
462 * Perform fixups on smart mode. We need to "lose" some 458 * Perform fixups on smart mode. We need to "lose" some
463 * capabilities the firmware lacks but does not filter, and 459 * capabilities the firmware lacks but does not filter, and
@@ -465,16 +461,6 @@ static void __devinit it821x_fixups(ide_hwif_t *hwif)
465 * in RAID mode. 461 * in RAID mode.
466 */ 462 */
467 463
468 for(i = 0; i < 2; i++) {
469 ide_drive_t *drive = &hwif->drives[i];
470 struct hd_driveid *id;
471 u16 *idbits;
472
473 if(!drive->present)
474 continue;
475 id = drive->id;
476 idbits = (u16 *)drive->id;
477
478 /* Check for RAID v native */ 464 /* Check for RAID v native */
479 if(strstr(id->model, "Integrated Technology Express")) { 465 if(strstr(id->model, "Integrated Technology Express")) {
480 /* In raid mode the ident block is slightly buggy 466 /* In raid mode the ident block is slightly buggy
@@ -537,6 +523,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
537 struct it821x_dev *idev = kzalloc(sizeof(struct it821x_dev), GFP_KERNEL); 523 struct it821x_dev *idev = kzalloc(sizeof(struct it821x_dev), GFP_KERNEL);
538 u8 conf; 524 u8 conf;
539 525
526 hwif->quirkproc = &it821x_quirkproc;
527
540 if (idev == NULL) { 528 if (idev == NULL) {
541 printk(KERN_ERR "it821x: out of memory, falling back to legacy behaviour.\n"); 529 printk(KERN_ERR "it821x: out of memory, falling back to legacy behaviour.\n");
542 return; 530 return;
@@ -633,7 +621,6 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha
633 .name = name_str, \ 621 .name = name_str, \
634 .init_chipset = init_chipset_it821x, \ 622 .init_chipset = init_chipset_it821x, \
635 .init_hwif = init_hwif_it821x, \ 623 .init_hwif = init_hwif_it821x, \
636 .fixup = it821x_fixups, \
637 .host_flags = IDE_HFLAG_BOOTABLE, \ 624 .host_flags = IDE_HFLAG_BOOTABLE, \
638 .pio_mask = ATA_PIO4, \ 625 .pio_mask = ATA_PIO4, \
639 } 626 }