1// SPDX-License-Identifier: GPL-2.0
2/* Copyright(c) 2016 - 2018 Intel Corporation. All rights reserved. */
3#include <linux/percpu-refcount.h>
4#include <linux/memremap.h>
5#include <linux/module.h>
6#include <linux/pfn_t.h>
7#include <linux/nd.h>
8#include "../bus.h"
9
10static int dax_pmem_probe(struct device *dev)
11{
12 return PTR_ERR_OR_ZERO(__dax_pmem_probe(dev, DEV_DAX_BUS));
13}
14
15static struct nd_device_driver dax_pmem_driver = {
16 .probe = dax_pmem_probe,
17 .drv = {
18 .name = "dax_pmem",
19 },
20 .type = ND_DRIVER_DAX_PMEM,
21};
22
23static int __init dax_pmem_init(void)
24{
25 return nd_driver_register(&dax_pmem_driver);
26}
27module_init(dax_pmem_init);
28
29static void __exit dax_pmem_exit(void)
30{
31 driver_unregister(&dax_pmem_driver.drv);
32}
33module_exit(dax_pmem_exit);
34
35MODULE_LICENSE("GPL v2");
36MODULE_AUTHOR("Intel Corporation");
37#if !IS_ENABLED(CONFIG_DEV_DAX_PMEM_COMPAT)
38/* For compat builds, don't load this module by default */
39MODULE_ALIAS_ND_DEVICE(ND_DEVICE_DAX_PMEM);
40#endif
41