Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (C) 2026 Intel Corporation */
3#include <linux/moduleparam.h>
4#include <linux/workqueue.h>
5#include "../../../drivers/dax/bus.h"
6
7static bool hmem_test;
8
9static void hmem_test_work(struct work_struct *work)
10{
11}
12
13static void hmem_test_release(struct device *dev)
14{
15 struct hmem_platform_device *hpdev =
16 container_of(dev, typeof(*hpdev), pdev.dev);
17
18 memset(hpdev, 0, sizeof(*hpdev));
19}
20
21static struct hmem_platform_device hmem_test_device = {
22 .pdev = {
23 .name = "hmem_platform",
24 .id = 1,
25 .dev = {
26 .release = hmem_test_release,
27 },
28 },
29 .work = __WORK_INITIALIZER(hmem_test_device.work, hmem_test_work),
30};
31
32int hmem_test_init(void)
33{
34 if (!hmem_test)
35 return 0;
36
37 return platform_device_register(&hmem_test_device.pdev);
38}
39
40void hmem_test_exit(void)
41{
42 if (hmem_test)
43 platform_device_unregister(&hmem_test_device.pdev);
44}
45
46module_param(hmem_test, bool, 0444);
47MODULE_PARM_DESC(hmem_test, "Enable/disable the dax_hmem test platform device");