diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:31 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:31 -0400 |
commit | fd9bb53942a7ca3398a63f2c238afd8fbed3ec0e (patch) | |
tree | eab9592f5bcbee89e0fdf9661e40a92d629d0a32 /drivers/ide/ide-probe.c | |
parent | 438c470261036db25bfae15235ba99812e3dc763 (diff) |
ide: add ->fixup method to ide_hwif_t
* Add ->fixup method to ide_hwif_t.
* Set hwif->fixup in ide_pci_setup_ports() to d->fixup.
* Use hwif->fixup in probe_hwif().
* Use probe_hwif_init() instead of probe_hwif_init_with_fixup() in
ide_setup_pci_device().
* Add 'fixup' argument to ide_register_hw() and use it to set hwif->fixup,
update all ide_register_hw() users accordingly.
* Convert ide-cs/delkin_cb host drivers to use ide_register_hw().
* Restore hwif->fixup in ide_hwif_restore().
* Remove ide_register_hw_with_fixup(), probe_hwif_init_with_fixup()
and 'fixup' argument from probe_hwif().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 549174853381..c6ba439b1435 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -717,7 +717,7 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave); | |||
717 | * This routine only knows how to look for drive units 0 and 1 | 717 | * This routine only knows how to look for drive units 0 and 1 |
718 | * on an interface, so any setting of MAX_DRIVES > 2 won't work here. | 718 | * on an interface, so any setting of MAX_DRIVES > 2 won't work here. |
719 | */ | 719 | */ |
720 | static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) | 720 | static void probe_hwif(ide_hwif_t *hwif) |
721 | { | 721 | { |
722 | unsigned long flags; | 722 | unsigned long flags; |
723 | unsigned int irqd; | 723 | unsigned int irqd; |
@@ -819,8 +819,8 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) | |||
819 | return; | 819 | return; |
820 | } | 820 | } |
821 | 821 | ||
822 | if (fixup) | 822 | if (hwif->fixup) |
823 | fixup(hwif); | 823 | hwif->fixup(hwif); |
824 | 824 | ||
825 | for (unit = 0; unit < MAX_DRIVES; ++unit) { | 825 | for (unit = 0; unit < MAX_DRIVES; ++unit) { |
826 | ide_drive_t *drive = &hwif->drives[unit]; | 826 | ide_drive_t *drive = &hwif->drives[unit]; |
@@ -861,9 +861,9 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) | |||
861 | static int hwif_init(ide_hwif_t *hwif); | 861 | static int hwif_init(ide_hwif_t *hwif); |
862 | static void hwif_register_devices(ide_hwif_t *hwif); | 862 | static void hwif_register_devices(ide_hwif_t *hwif); |
863 | 863 | ||
864 | int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) | 864 | int probe_hwif_init(ide_hwif_t *hwif) |
865 | { | 865 | { |
866 | probe_hwif(hwif, fixup); | 866 | probe_hwif(hwif); |
867 | 867 | ||
868 | if (!hwif_init(hwif)) { | 868 | if (!hwif_init(hwif)) { |
869 | printk(KERN_INFO "%s: failed to initialize IDE interface\n", | 869 | printk(KERN_INFO "%s: failed to initialize IDE interface\n", |
@@ -877,11 +877,6 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif) | |||
877 | return 0; | 877 | return 0; |
878 | } | 878 | } |
879 | 879 | ||
880 | int probe_hwif_init(ide_hwif_t *hwif) | ||
881 | { | ||
882 | return probe_hwif_init_with_fixup(hwif, NULL); | ||
883 | } | ||
884 | |||
885 | EXPORT_SYMBOL(probe_hwif_init); | 880 | EXPORT_SYMBOL(probe_hwif_init); |
886 | 881 | ||
887 | #if MAX_HWIFS > 1 | 882 | #if MAX_HWIFS > 1 |
@@ -1394,7 +1389,7 @@ int ideprobe_init (void) | |||
1394 | 1389 | ||
1395 | for (index = 0; index < MAX_HWIFS; ++index) | 1390 | for (index = 0; index < MAX_HWIFS; ++index) |
1396 | if (probe[index]) | 1391 | if (probe[index]) |
1397 | probe_hwif(&ide_hwifs[index], NULL); | 1392 | probe_hwif(&ide_hwifs[index]); |
1398 | for (index = 0; index < MAX_HWIFS; ++index) | 1393 | for (index = 0; index < MAX_HWIFS; ++index) |
1399 | if (probe[index]) | 1394 | if (probe[index]) |
1400 | hwif_init(&ide_hwifs[index]); | 1395 | hwif_init(&ide_hwifs[index]); |