From 898652b1c63135840be0bafdf1ce6af09a2e6861 Mon Sep 17 00:00:00 2001 From: Ravikiran G Thirumalai Date: Thu, 4 Aug 2005 12:53:26 -0700 Subject: [PATCH] --- yaml --- r: 5626 b: refs/heads/master c: 556e58febf90c8cb1da25669d0892bf5fd2ddac2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/ide/ide-probe.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 475f125b6e3d..f152d64c10f3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd6f31c31825f62eb91f491e8316129e5ce81fc6 +refs/heads/master: 556e58febf90c8cb1da25669d0892bf5fd2ddac2 diff --git a/trunk/drivers/ide/ide-probe.c b/trunk/drivers/ide/ide-probe.c index 7df85af75371..94daf40ae323 100644 --- a/trunk/drivers/ide/ide-probe.c +++ b/trunk/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) } #endif /* MAX_HWIFS > 1 */ +static inline int hwif_to_node(ide_hwif_t *hwif) +{ + if (hwif->pci_dev) + return pcibus_to_node(hwif->pci_dev->bus); + else + /* Add ways to determine the node of other busses here */ + return -1; +} + /* * init request queue */ @@ -978,8 +987,7 @@ static int ide_init_queue(ide_drive_t *drive) * do not. */ - q = blk_init_queue_node(do_ide_request, &ide_lock, - pcibus_to_node(drive->hwif->pci_dev->bus)); + q = blk_init_queue_node(do_ide_request, &ide_lock, hwif_to_node(hwif)); if (!q) return 1; @@ -1048,6 +1056,8 @@ static int init_irq (ide_hwif_t *hwif) BUG_ON(in_interrupt()); BUG_ON(irqs_disabled()); + BUG_ON(hwif == NULL); + down(&ide_cfg_sem); hwif->hwgroup = NULL; #if MAX_HWIFS > 1 @@ -1097,7 +1107,7 @@ static int init_irq (ide_hwif_t *hwif) spin_unlock_irq(&ide_lock); } else { hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL, - pcibus_to_node(hwif->drives[0].hwif->pci_dev->bus)); + hwif_to_node(hwif->drives[0].hwif)); if (!hwgroup) goto out_up;