]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
ec776ef6 CH |
2 | /* |
3 | * Copyright (c) 2015, Christoph Hellwig. | |
9f53f9fa | 4 | * Copyright (c) 2015, Intel Corporation. |
ec776ef6 | 5 | */ |
ec776ef6 | 6 | #include <linux/platform_device.h> |
186f4360 | 7 | #include <linux/init.h> |
bc0d0d09 DW |
8 | #include <linux/ioport.h> |
9 | ||
1d2e733b | 10 | static int found(struct resource *res, void *data) |
bc0d0d09 DW |
11 | { |
12 | return 1; | |
13 | } | |
ec776ef6 | 14 | |
9f53f9fa | 15 | static __init int register_e820_pmem(void) |
ec776ef6 | 16 | { |
7a67832c | 17 | struct platform_device *pdev; |
bc0d0d09 DW |
18 | int rc; |
19 | ||
f0f4711a TK |
20 | rc = walk_iomem_res_desc(IORES_DESC_PERSISTENT_MEMORY_LEGACY, |
21 | IORESOURCE_MEM, 0, -1, NULL, found); | |
bc0d0d09 DW |
22 | if (rc <= 0) |
23 | return 0; | |
7a67832c DW |
24 | |
25 | /* | |
26 | * See drivers/nvdimm/e820.c for the implementation, this is | |
27 | * simply here to trigger the module to load on demand. | |
28 | */ | |
29 | pdev = platform_device_alloc("e820_pmem", -1); | |
30 | return platform_device_add(pdev); | |
ec776ef6 | 31 | } |
9f53f9fa | 32 | device_initcall(register_e820_pmem); |