diff options
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 7df85af75371..94daf40ae323 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -960,6 +960,15 @@ static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) | |||
960 | } | 960 | } |
961 | #endif /* MAX_HWIFS > 1 */ | 961 | #endif /* MAX_HWIFS > 1 */ |
962 | 962 | ||
963 | static inline int hwif_to_node(ide_hwif_t *hwif) | ||
964 | { | ||
965 | if (hwif->pci_dev) | ||
966 | return pcibus_to_node(hwif->pci_dev->bus); | ||
967 | else | ||
968 | /* Add ways to determine the node of other busses here */ | ||
969 | return -1; | ||
970 | } | ||
971 | |||
963 | /* | 972 | /* |
964 | * init request queue | 973 | * init request queue |
965 | */ | 974 | */ |
@@ -978,8 +987,7 @@ static int ide_init_queue(ide_drive_t *drive) | |||
978 | * do not. | 987 | * do not. |
979 | */ | 988 | */ |
980 | 989 | ||
981 | q = blk_init_queue_node(do_ide_request, &ide_lock, | 990 | q = blk_init_queue_node(do_ide_request, &ide_lock, hwif_to_node(hwif)); |
982 | pcibus_to_node(drive->hwif->pci_dev->bus)); | ||
983 | if (!q) | 991 | if (!q) |
984 | return 1; | 992 | return 1; |
985 | 993 | ||
@@ -1048,6 +1056,8 @@ static int init_irq (ide_hwif_t *hwif) | |||
1048 | 1056 | ||
1049 | BUG_ON(in_interrupt()); | 1057 | BUG_ON(in_interrupt()); |
1050 | BUG_ON(irqs_disabled()); | 1058 | BUG_ON(irqs_disabled()); |
1059 | BUG_ON(hwif == NULL); | ||
1060 | |||
1051 | down(&ide_cfg_sem); | 1061 | down(&ide_cfg_sem); |
1052 | hwif->hwgroup = NULL; | 1062 | hwif->hwgroup = NULL; |
1053 | #if MAX_HWIFS > 1 | 1063 | #if MAX_HWIFS > 1 |
@@ -1097,7 +1107,7 @@ static int init_irq (ide_hwif_t *hwif) | |||
1097 | spin_unlock_irq(&ide_lock); | 1107 | spin_unlock_irq(&ide_lock); |
1098 | } else { | 1108 | } else { |
1099 | hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL, | 1109 | hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL, |
1100 | pcibus_to_node(hwif->drives[0].hwif->pci_dev->bus)); | 1110 | hwif_to_node(hwif->drives[0].hwif)); |
1101 | if (!hwgroup) | 1111 | if (!hwgroup) |
1102 | goto out_up; | 1112 | goto out_up; |
1103 | 1113 | ||