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