diff options
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_res.c')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_res.c | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c index aee6e41001e1..5e8caf7a4452 100644 --- a/drivers/pci/hotplug/ibmphp_res.c +++ b/drivers/pci/hotplug/ibmphp_res.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * IBM Hot Plug Controller Driver | 3 | * IBM Hot Plug Controller Driver |
3 | * | 4 | * |
@@ -8,21 +9,6 @@ | |||
8 | * | 9 | * |
9 | * All rights reserved. | 10 | * All rights reserved. |
10 | * | 11 | * |
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or (at | ||
14 | * your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but | ||
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
19 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
20 | * details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | * | ||
26 | * Send feedback to <gregkh@us.ibm.com> | 12 | * Send feedback to <gregkh@us.ibm.com> |
27 | * | 13 | * |
28 | */ | 14 | */ |
@@ -56,10 +42,8 @@ static struct bus_node * __init alloc_error_bus(struct ebda_pci_rsrc *curr, u8 b | |||
56 | } | 42 | } |
57 | 43 | ||
58 | newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); | 44 | newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); |
59 | if (!newbus) { | 45 | if (!newbus) |
60 | err("out of system memory\n"); | ||
61 | return NULL; | 46 | return NULL; |
62 | } | ||
63 | 47 | ||
64 | if (flag) | 48 | if (flag) |
65 | newbus->busno = busno; | 49 | newbus->busno = busno; |
@@ -79,10 +63,9 @@ static struct resource_node * __init alloc_resources(struct ebda_pci_rsrc *curr) | |||
79 | } | 63 | } |
80 | 64 | ||
81 | rs = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 65 | rs = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
82 | if (!rs) { | 66 | if (!rs) |
83 | err("out of system memory\n"); | ||
84 | return NULL; | 67 | return NULL; |
85 | } | 68 | |
86 | rs->busno = curr->bus_num; | 69 | rs->busno = curr->bus_num; |
87 | rs->devfunc = curr->dev_fun; | 70 | rs->devfunc = curr->dev_fun; |
88 | rs->start = curr->start_addr; | 71 | rs->start = curr->start_addr; |
@@ -99,10 +82,9 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * | |||
99 | 82 | ||
100 | if (first_bus) { | 83 | if (first_bus) { |
101 | newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); | 84 | newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); |
102 | if (!newbus) { | 85 | if (!newbus) |
103 | err("out of system memory.\n"); | ||
104 | return -ENOMEM; | 86 | return -ENOMEM; |
105 | } | 87 | |
106 | newbus->busno = curr->bus_num; | 88 | newbus->busno = curr->bus_num; |
107 | } else { | 89 | } else { |
108 | newbus = *new_bus; | 90 | newbus = *new_bus; |
@@ -123,7 +105,6 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * | |||
123 | if (!newrange) { | 105 | if (!newrange) { |
124 | if (first_bus) | 106 | if (first_bus) |
125 | kfree(newbus); | 107 | kfree(newbus); |
126 | err("out of system memory\n"); | ||
127 | return -ENOMEM; | 108 | return -ENOMEM; |
128 | } | 109 | } |
129 | newrange->start = curr->start_addr; | 110 | newrange->start = curr->start_addr; |
@@ -1707,10 +1688,9 @@ static int __init once_over(void) | |||
1707 | bus_cur->firstPFMemFromMem = pfmem_cur; | 1688 | bus_cur->firstPFMemFromMem = pfmem_cur; |
1708 | 1689 | ||
1709 | mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 1690 | mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
1710 | if (!mem) { | 1691 | if (!mem) |
1711 | err("out of system memory\n"); | ||
1712 | return -ENOMEM; | 1692 | return -ENOMEM; |
1713 | } | 1693 | |
1714 | mem->type = MEM; | 1694 | mem->type = MEM; |
1715 | mem->busno = pfmem_cur->busno; | 1695 | mem->busno = pfmem_cur->busno; |
1716 | mem->devfunc = pfmem_cur->devfunc; | 1696 | mem->devfunc = pfmem_cur->devfunc; |
@@ -1989,10 +1969,9 @@ static int __init update_bridge_ranges(struct bus_node **bus) | |||
1989 | 1969 | ||
1990 | if ((start_address) && (start_address <= end_address)) { | 1970 | if ((start_address) && (start_address <= end_address)) { |
1991 | range = kzalloc(sizeof(struct range_node), GFP_KERNEL); | 1971 | range = kzalloc(sizeof(struct range_node), GFP_KERNEL); |
1992 | if (!range) { | 1972 | if (!range) |
1993 | err("out of system memory\n"); | ||
1994 | return -ENOMEM; | 1973 | return -ENOMEM; |
1995 | } | 1974 | |
1996 | range->start = start_address; | 1975 | range->start = start_address; |
1997 | range->end = end_address + 0xfff; | 1976 | range->end = end_address + 0xfff; |
1998 | 1977 | ||
@@ -2016,7 +1995,6 @@ static int __init update_bridge_ranges(struct bus_node **bus) | |||
2016 | io = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 1995 | io = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
2017 | if (!io) { | 1996 | if (!io) { |
2018 | kfree(range); | 1997 | kfree(range); |
2019 | err("out of system memory\n"); | ||
2020 | return -ENOMEM; | 1998 | return -ENOMEM; |
2021 | } | 1999 | } |
2022 | io->type = IO; | 2000 | io->type = IO; |
@@ -2038,10 +2016,9 @@ static int __init update_bridge_ranges(struct bus_node **bus) | |||
2038 | if ((start_address) && (start_address <= end_address)) { | 2016 | if ((start_address) && (start_address <= end_address)) { |
2039 | 2017 | ||
2040 | range = kzalloc(sizeof(struct range_node), GFP_KERNEL); | 2018 | range = kzalloc(sizeof(struct range_node), GFP_KERNEL); |
2041 | if (!range) { | 2019 | if (!range) |
2042 | err("out of system memory\n"); | ||
2043 | return -ENOMEM; | 2020 | return -ENOMEM; |
2044 | } | 2021 | |
2045 | range->start = start_address; | 2022 | range->start = start_address; |
2046 | range->end = end_address + 0xfffff; | 2023 | range->end = end_address + 0xfffff; |
2047 | 2024 | ||
@@ -2066,7 +2043,6 @@ static int __init update_bridge_ranges(struct bus_node **bus) | |||
2066 | mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 2043 | mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
2067 | if (!mem) { | 2044 | if (!mem) { |
2068 | kfree(range); | 2045 | kfree(range); |
2069 | err("out of system memory\n"); | ||
2070 | return -ENOMEM; | 2046 | return -ENOMEM; |
2071 | } | 2047 | } |
2072 | mem->type = MEM; | 2048 | mem->type = MEM; |
@@ -2092,10 +2068,9 @@ static int __init update_bridge_ranges(struct bus_node **bus) | |||
2092 | if ((start_address) && (start_address <= end_address)) { | 2068 | if ((start_address) && (start_address <= end_address)) { |
2093 | 2069 | ||
2094 | range = kzalloc(sizeof(struct range_node), GFP_KERNEL); | 2070 | range = kzalloc(sizeof(struct range_node), GFP_KERNEL); |
2095 | if (!range) { | 2071 | if (!range) |
2096 | err("out of system memory\n"); | ||
2097 | return -ENOMEM; | 2072 | return -ENOMEM; |
2098 | } | 2073 | |
2099 | range->start = start_address; | 2074 | range->start = start_address; |
2100 | range->end = end_address + 0xfffff; | 2075 | range->end = end_address + 0xfffff; |
2101 | 2076 | ||
@@ -2119,7 +2094,6 @@ static int __init update_bridge_ranges(struct bus_node **bus) | |||
2119 | pfmem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); | 2094 | pfmem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); |
2120 | if (!pfmem) { | 2095 | if (!pfmem) { |
2121 | kfree(range); | 2096 | kfree(range); |
2122 | err("out of system memory\n"); | ||
2123 | return -ENOMEM; | 2097 | return -ENOMEM; |
2124 | } | 2098 | } |
2125 | pfmem->type = PFMEM; | 2099 | pfmem->type = PFMEM; |