VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / pci / hotplug / pciehprm_nonacpi.c
index 3ace442..79a0aa6 100644 (file)
@@ -276,7 +276,7 @@ static int pciehprm_delete_resource(
 
 static int bind_pci_resources_to_slots ( struct controller *ctrl)
 {
-       struct pci_func *func;
+       struct pci_func *func, new_func;
        int busn = ctrl->slot_bus;
        int devn, funn;
        u32     vid;
@@ -297,11 +297,19 @@ static int bind_pci_resources_to_slots ( struct controller *ctrl)
                                vid, busn, devn, funn);
                                func = pciehp_slot_find(busn, devn, funn);
                                dbg("%s: func = %p\n", __FUNCTION__,func);
-                               if (!func)
-                                       continue;
-                               configure_existing_function(ctrl, func);
+                               if (!func) {
+                                       memset(&new_func, 0, sizeof(struct pci_func));
+                                       new_func.bus = busn;
+                                       new_func.device = devn;
+                                       new_func.function = funn;
+                                       new_func.is_a_board = 1;
+                                       configure_existing_function(ctrl, &new_func);
+                                       phprm_dump_func_res(&new_func);
+                               } else {
+                                       configure_existing_function(ctrl, func);
+                                       phprm_dump_func_res(func);
+                               }
                                dbg("aCCF:existing PCI 0x%x Func ResourceDump\n", ctrl->bus);
-                               phprm_dump_func_res(func);
                        }
                }
        }