hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/alpha/kernel/pci.c
....@@ -18,7 +18,7 @@
1818 #include <linux/init.h>
1919 #include <linux/ioport.h>
2020 #include <linux/kernel.h>
21
-#include <linux/bootmem.h>
21
+#include <linux/memblock.h>
2222 #include <linux/module.h>
2323 #include <linux/cache.h>
2424 #include <linux/slab.h>
....@@ -392,7 +392,10 @@
392392 {
393393 struct pci_controller *hose;
394394
395
- hose = alloc_bootmem(sizeof(*hose));
395
+ hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES);
396
+ if (!hose)
397
+ panic("%s: Failed to allocate %zu bytes\n", __func__,
398
+ sizeof(*hose));
396399
397400 *hose_tail = hose;
398401 hose_tail = &hose->next;
....@@ -403,7 +406,13 @@
403406 struct resource * __init
404407 alloc_resource(void)
405408 {
406
- return alloc_bootmem(sizeof(struct resource));
409
+ void *ptr = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
410
+
411
+ if (!ptr)
412
+ panic("%s: Failed to allocate %zu bytes\n", __func__,
413
+ sizeof(struct resource));
414
+
415
+ return ptr;
407416 }
408417
409418