diff options
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_pci.c')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_pci.c | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index 25edd0b18b75..c7ce7d8cf998 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c | |||
@@ -167,10 +167,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) | |||
167 | goto error; | 167 | goto error; |
168 | } | 168 | } |
169 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); | 169 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); |
170 | if (!newfunc) { | 170 | if (!newfunc) |
171 | err("out of system memory\n"); | ||
172 | return -ENOMEM; | 171 | return -ENOMEM; |
173 | } | 172 | |
174 | newfunc->busno = cur_func->busno; | 173 | newfunc->busno = cur_func->busno; |
175 | newfunc->device = device; | 174 | newfunc->device = device; |
176 | cur_func->next = newfunc; | 175 | cur_func->next = newfunc; |
@@ -205,10 +204,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) | |||
205 | for (i = 0; i < 32; i++) { | 204 | for (i = 0; i < 32; i++) { |
206 | if (func->devices[i]) { | 205 | if (func->devices[i]) { |
207 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); | 206 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); |
208 | if (!newfunc) { | 207 | if (!newfunc) |
209 | err("out of system memory\n"); | ||
210 | return -ENOMEM; | 208 | return -ENOMEM; |
211 | } | 209 | |
212 | newfunc->busno = sec_number; | 210 | newfunc->busno = sec_number; |
213 | newfunc->device = (u8) i; | 211 | newfunc->device = (u8) i; |
214 | for (j = 0; j < 4; j++) | 212 | for (j = 0; j < 4; j++) |
@@ -233,10 +231,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) | |||
233 | } | 231 | } |
234 | 232 | ||
235 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); | 233 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); |
236 | if (!newfunc) { | 234 | if (!newfunc) |
237 | err("out of system memory\n"); | ||
238 | return -ENOMEM; | 235 | return -ENOMEM; |
239 | } | 236 | |
240 | newfunc->busno = cur_func->busno; | 237 | newfunc->busno = cur_func->busno; |
241 | newfunc->device = device; | 238 | newfunc->device = device; |
242 | for (j = 0; j < 4; j++) | 239 | for (j = 0; j < 4; j++) |
@@ -279,10 +276,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) | |||
279 | if (func->devices[i]) { | 276 | if (func->devices[i]) { |
280 | debug("inside for loop, device is %x\n", i); | 277 | debug("inside for loop, device is %x\n", i); |
281 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); | 278 | newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); |
282 | if (!newfunc) { | 279 | if (!newfunc) |
283 | err(" out of system memory\n"); | ||
284 | return -ENOMEM; | 280 | return -ENOMEM; |
285 | } | 281 | |
286 | newfunc->busno = sec_number; | 282 | newfunc->busno = sec_number; |
287 | newfunc->device = (u8) i; | 283 | newfunc->device = (u8) i; |
288 | for (j = 0; j < 4; j++) | 284 | for (j = 0; j < 4; j++) |
@@ -405,10 +401,9 @@ static int configure_device(struct pci_func *func) | |||
405 | 401 | ||
406 | io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 402 | io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
407 | 403 | ||
408 | if (!io[count]) { | 404 | if (!io[count]) |
409 | err("out of system memory\n"); | ||
410 | return -ENOMEM; | 405 | return -ENOMEM; |
411 | } | 406 | |
412 | io[count]->type = IO; | 407 | io[count]->type = IO; |
413 | io[count]->busno = func->busno; | 408 | io[count]->busno = func->busno; |
414 | io[count]->devfunc = PCI_DEVFN(func->device, func->function); | 409 | io[count]->devfunc = PCI_DEVFN(func->device, func->function); |
@@ -442,10 +437,9 @@ static int configure_device(struct pci_func *func) | |||
442 | debug("len[count] in PFMEM %x, count %d\n", len[count], count); | 437 | debug("len[count] in PFMEM %x, count %d\n", len[count], count); |
443 | 438 | ||
444 | pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 439 | pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
445 | if (!pfmem[count]) { | 440 | if (!pfmem[count]) |
446 | err("out of system memory\n"); | ||
447 | return -ENOMEM; | 441 | return -ENOMEM; |
448 | } | 442 | |
449 | pfmem[count]->type = PFMEM; | 443 | pfmem[count]->type = PFMEM; |
450 | pfmem[count]->busno = func->busno; | 444 | pfmem[count]->busno = func->busno; |
451 | pfmem[count]->devfunc = PCI_DEVFN(func->device, | 445 | pfmem[count]->devfunc = PCI_DEVFN(func->device, |
@@ -458,7 +452,6 @@ static int configure_device(struct pci_func *func) | |||
458 | } else { | 452 | } else { |
459 | mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); | 453 | mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); |
460 | if (!mem_tmp) { | 454 | if (!mem_tmp) { |
461 | err("out of system memory\n"); | ||
462 | kfree(pfmem[count]); | 455 | kfree(pfmem[count]); |
463 | return -ENOMEM; | 456 | return -ENOMEM; |
464 | } | 457 | } |
@@ -508,10 +501,9 @@ static int configure_device(struct pci_func *func) | |||
508 | debug("len[count] in Mem %x, count %d\n", len[count], count); | 501 | debug("len[count] in Mem %x, count %d\n", len[count], count); |
509 | 502 | ||
510 | mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 503 | mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
511 | if (!mem[count]) { | 504 | if (!mem[count]) |
512 | err("out of system memory\n"); | ||
513 | return -ENOMEM; | 505 | return -ENOMEM; |
514 | } | 506 | |
515 | mem[count]->type = MEM; | 507 | mem[count]->type = MEM; |
516 | mem[count]->busno = func->busno; | 508 | mem[count]->busno = func->busno; |
517 | mem[count]->devfunc = PCI_DEVFN(func->device, | 509 | mem[count]->devfunc = PCI_DEVFN(func->device, |
@@ -674,7 +666,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
674 | bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 666 | bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
675 | 667 | ||
676 | if (!bus_io[count]) { | 668 | if (!bus_io[count]) { |
677 | err("out of system memory\n"); | ||
678 | retval = -ENOMEM; | 669 | retval = -ENOMEM; |
679 | goto error; | 670 | goto error; |
680 | } | 671 | } |
@@ -706,7 +697,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
706 | 697 | ||
707 | bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 698 | bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
708 | if (!bus_pfmem[count]) { | 699 | if (!bus_pfmem[count]) { |
709 | err("out of system memory\n"); | ||
710 | retval = -ENOMEM; | 700 | retval = -ENOMEM; |
711 | goto error; | 701 | goto error; |
712 | } | 702 | } |
@@ -722,7 +712,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
722 | } else { | 712 | } else { |
723 | mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); | 713 | mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); |
724 | if (!mem_tmp) { | 714 | if (!mem_tmp) { |
725 | err("out of system memory\n"); | ||
726 | retval = -ENOMEM; | 715 | retval = -ENOMEM; |
727 | goto error; | 716 | goto error; |
728 | } | 717 | } |
@@ -763,7 +752,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
763 | 752 | ||
764 | bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 753 | bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
765 | if (!bus_mem[count]) { | 754 | if (!bus_mem[count]) { |
766 | err("out of system memory\n"); | ||
767 | retval = -ENOMEM; | 755 | retval = -ENOMEM; |
768 | goto error; | 756 | goto error; |
769 | } | 757 | } |
@@ -834,7 +822,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
834 | io = kzalloc(sizeof(*io), GFP_KERNEL); | 822 | io = kzalloc(sizeof(*io), GFP_KERNEL); |
835 | 823 | ||
836 | if (!io) { | 824 | if (!io) { |
837 | err("out of system memory\n"); | ||
838 | retval = -ENOMEM; | 825 | retval = -ENOMEM; |
839 | goto error; | 826 | goto error; |
840 | } | 827 | } |
@@ -856,7 +843,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
856 | debug("it wants %x memory behind the bridge\n", amount_needed->mem); | 843 | debug("it wants %x memory behind the bridge\n", amount_needed->mem); |
857 | mem = kzalloc(sizeof(*mem), GFP_KERNEL); | 844 | mem = kzalloc(sizeof(*mem), GFP_KERNEL); |
858 | if (!mem) { | 845 | if (!mem) { |
859 | err("out of system memory\n"); | ||
860 | retval = -ENOMEM; | 846 | retval = -ENOMEM; |
861 | goto error; | 847 | goto error; |
862 | } | 848 | } |
@@ -878,7 +864,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
878 | debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); | 864 | debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); |
879 | pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL); | 865 | pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL); |
880 | if (!pfmem) { | 866 | if (!pfmem) { |
881 | err("out of system memory\n"); | ||
882 | retval = -ENOMEM; | 867 | retval = -ENOMEM; |
883 | goto error; | 868 | goto error; |
884 | } | 869 | } |
@@ -893,7 +878,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
893 | } else { | 878 | } else { |
894 | mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); | 879 | mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); |
895 | if (!mem_tmp) { | 880 | if (!mem_tmp) { |
896 | err("out of system memory\n"); | ||
897 | retval = -ENOMEM; | 881 | retval = -ENOMEM; |
898 | goto error; | 882 | goto error; |
899 | } | 883 | } |
@@ -924,7 +908,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) | |||
924 | if (!bus) { | 908 | if (!bus) { |
925 | bus = kzalloc(sizeof(*bus), GFP_KERNEL); | 909 | bus = kzalloc(sizeof(*bus), GFP_KERNEL); |
926 | if (!bus) { | 910 | if (!bus) { |
927 | err("out of system memory\n"); | ||
928 | retval = -ENOMEM; | 911 | retval = -ENOMEM; |
929 | goto error; | 912 | goto error; |
930 | } | 913 | } |
@@ -1652,10 +1635,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re | |||
1652 | } | 1635 | } |
1653 | if (io) { | 1636 | if (io) { |
1654 | io_range = kzalloc(sizeof(*io_range), GFP_KERNEL); | 1637 | io_range = kzalloc(sizeof(*io_range), GFP_KERNEL); |
1655 | if (!io_range) { | 1638 | if (!io_range) |
1656 | err("out of system memory\n"); | ||
1657 | return -ENOMEM; | 1639 | return -ENOMEM; |
1658 | } | 1640 | |
1659 | io_range->start = io->start; | 1641 | io_range->start = io->start; |
1660 | io_range->end = io->end; | 1642 | io_range->end = io->end; |
1661 | io_range->rangeno = 1; | 1643 | io_range->rangeno = 1; |
@@ -1664,10 +1646,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re | |||
1664 | } | 1646 | } |
1665 | if (mem) { | 1647 | if (mem) { |
1666 | mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL); | 1648 | mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL); |
1667 | if (!mem_range) { | 1649 | if (!mem_range) |
1668 | err("out of system memory\n"); | ||
1669 | return -ENOMEM; | 1650 | return -ENOMEM; |
1670 | } | 1651 | |
1671 | mem_range->start = mem->start; | 1652 | mem_range->start = mem->start; |
1672 | mem_range->end = mem->end; | 1653 | mem_range->end = mem->end; |
1673 | mem_range->rangeno = 1; | 1654 | mem_range->rangeno = 1; |
@@ -1676,10 +1657,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re | |||
1676 | } | 1657 | } |
1677 | if (pfmem) { | 1658 | if (pfmem) { |
1678 | pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL); | 1659 | pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL); |
1679 | if (!pfmem_range) { | 1660 | if (!pfmem_range) |
1680 | err("out of system memory\n"); | ||
1681 | return -ENOMEM; | 1661 | return -ENOMEM; |
1682 | } | 1662 | |
1683 | pfmem_range->start = pfmem->start; | 1663 | pfmem_range->start = pfmem->start; |
1684 | pfmem_range->end = pfmem->end; | 1664 | pfmem_range->end = pfmem->end; |
1685 | pfmem_range->rangeno = 1; | 1665 | pfmem_range->rangeno = 1; |