hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/alpha/kernel/pci-noop.c
....@@ -7,7 +7,7 @@
77
88 #include <linux/pci.h>
99 #include <linux/init.h>
10
-#include <linux/bootmem.h>
10
+#include <linux/memblock.h>
1111 #include <linux/gfp.h>
1212 #include <linux/capability.h>
1313 #include <linux/mm.h>
....@@ -33,7 +33,10 @@
3333 {
3434 struct pci_controller *hose;
3535
36
- hose = alloc_bootmem(sizeof(*hose));
36
+ hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES);
37
+ if (!hose)
38
+ panic("%s: Failed to allocate %zu bytes\n", __func__,
39
+ sizeof(*hose));
3740
3841 *hose_tail = hose;
3942 hose_tail = &hose->next;
....@@ -44,7 +47,13 @@
4447 struct resource * __init
4548 alloc_resource(void)
4649 {
47
- return alloc_bootmem(sizeof(struct resource));
50
+ void *ptr = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
51
+
52
+ if (!ptr)
53
+ panic("%s: Failed to allocate %zu bytes\n", __func__,
54
+ sizeof(struct resource));
55
+
56
+ return ptr;
4857 }
4958
5059 SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus,
....@@ -54,7 +63,7 @@
5463
5564 /* from hose or from bus.devfn */
5665 if (which & IOBASE_FROM_HOSE) {
57
- for (hose = hose_head; hose; hose = hose->next)
66
+ for (hose = hose_head; hose; hose = hose->next)
5867 if (hose->index == bus)
5968 break;
6069 if (!hose)