|
@@ -167,10 +167,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
|
|
|
goto error;
|
|
|
}
|
|
|
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
|
|
|
- if (!newfunc) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!newfunc)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
newfunc->busno = cur_func->busno;
|
|
|
newfunc->device = device;
|
|
|
cur_func->next = newfunc;
|
|
@@ -205,10 +204,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
if (func->devices[i]) {
|
|
|
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
|
|
|
- if (!newfunc) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!newfunc)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
newfunc->busno = sec_number;
|
|
|
newfunc->device = (u8) i;
|
|
|
for (j = 0; j < 4; j++)
|
|
@@ -233,10 +231,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
|
|
|
}
|
|
|
|
|
|
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
|
|
|
- if (!newfunc) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!newfunc)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
newfunc->busno = cur_func->busno;
|
|
|
newfunc->device = device;
|
|
|
for (j = 0; j < 4; j++)
|
|
@@ -279,10 +276,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
|
|
|
if (func->devices[i]) {
|
|
|
debug("inside for loop, device is %x\n", i);
|
|
|
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
|
|
|
- if (!newfunc) {
|
|
|
- err(" out of system memory\n");
|
|
|
+ if (!newfunc)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
newfunc->busno = sec_number;
|
|
|
newfunc->device = (u8) i;
|
|
|
for (j = 0; j < 4; j++)
|
|
@@ -405,10 +401,9 @@ static int configure_device(struct pci_func *func)
|
|
|
|
|
|
io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
|
|
|
|
|
|
- if (!io[count]) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!io[count])
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
io[count]->type = IO;
|
|
|
io[count]->busno = func->busno;
|
|
|
io[count]->devfunc = PCI_DEVFN(func->device, func->function);
|
|
@@ -442,10 +437,9 @@ static int configure_device(struct pci_func *func)
|
|
|
debug("len[count] in PFMEM %x, count %d\n", len[count], count);
|
|
|
|
|
|
pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
|
|
|
- if (!pfmem[count]) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!pfmem[count])
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
pfmem[count]->type = PFMEM;
|
|
|
pfmem[count]->busno = func->busno;
|
|
|
pfmem[count]->devfunc = PCI_DEVFN(func->device,
|
|
@@ -458,7 +452,6 @@ static int configure_device(struct pci_func *func)
|
|
|
} else {
|
|
|
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
|
|
|
if (!mem_tmp) {
|
|
|
- err("out of system memory\n");
|
|
|
kfree(pfmem[count]);
|
|
|
return -ENOMEM;
|
|
|
}
|
|
@@ -508,10 +501,9 @@ static int configure_device(struct pci_func *func)
|
|
|
debug("len[count] in Mem %x, count %d\n", len[count], count);
|
|
|
|
|
|
mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
|
|
|
- if (!mem[count]) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!mem[count])
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
mem[count]->type = MEM;
|
|
|
mem[count]->busno = func->busno;
|
|
|
mem[count]->devfunc = PCI_DEVFN(func->device,
|
|
@@ -674,7 +666,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
|
|
|
|
|
|
if (!bus_io[count]) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -706,7 +697,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
|
|
|
bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
|
|
|
if (!bus_pfmem[count]) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -722,7 +712,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
} else {
|
|
|
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
|
|
|
if (!mem_tmp) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -763,7 +752,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
|
|
|
bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
|
|
|
if (!bus_mem[count]) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -834,7 +822,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
io = kzalloc(sizeof(*io), GFP_KERNEL);
|
|
|
|
|
|
if (!io) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -856,7 +843,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
debug("it wants %x memory behind the bridge\n", amount_needed->mem);
|
|
|
mem = kzalloc(sizeof(*mem), GFP_KERNEL);
|
|
|
if (!mem) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -878,7 +864,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem);
|
|
|
pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL);
|
|
|
if (!pfmem) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -893,7 +878,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
} else {
|
|
|
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
|
|
|
if (!mem_tmp) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -924,7 +908,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
|
|
|
if (!bus) {
|
|
|
bus = kzalloc(sizeof(*bus), GFP_KERNEL);
|
|
|
if (!bus) {
|
|
|
- err("out of system memory\n");
|
|
|
retval = -ENOMEM;
|
|
|
goto error;
|
|
|
}
|
|
@@ -1652,10 +1635,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re
|
|
|
}
|
|
|
if (io) {
|
|
|
io_range = kzalloc(sizeof(*io_range), GFP_KERNEL);
|
|
|
- if (!io_range) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!io_range)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
io_range->start = io->start;
|
|
|
io_range->end = io->end;
|
|
|
io_range->rangeno = 1;
|
|
@@ -1664,10 +1646,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re
|
|
|
}
|
|
|
if (mem) {
|
|
|
mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL);
|
|
|
- if (!mem_range) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!mem_range)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
mem_range->start = mem->start;
|
|
|
mem_range->end = mem->end;
|
|
|
mem_range->rangeno = 1;
|
|
@@ -1676,10 +1657,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re
|
|
|
}
|
|
|
if (pfmem) {
|
|
|
pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL);
|
|
|
- if (!pfmem_range) {
|
|
|
- err("out of system memory\n");
|
|
|
+ if (!pfmem_range)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
+
|
|
|
pfmem_range->start = pfmem->start;
|
|
|
pfmem_range->end = pfmem->end;
|
|
|
pfmem_range->rangeno = 1;
|