hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/dax/device.c
....@@ -1,15 +1,6 @@
1
-/*
2
- * Copyright(c) 2016 - 2017 Intel Corporation. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of version 2 of the GNU General Public License as
6
- * published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful, but
9
- * WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- * General Public License for more details.
12
- */
1
+// SPDX-License-Identifier: GPL-2.0
2
+/* Copyright(c) 2016-2018 Intel Corporation. All rights reserved. */
3
+#include <linux/memremap.h>
134 #include <linux/pagemap.h>
145 #include <linux/module.h>
156 #include <linux/device.h>
....@@ -21,166 +12,11 @@
2112 #include <linux/mm.h>
2213 #include <linux/mman.h>
2314 #include "dax-private.h"
24
-#include "dax.h"
25
-
26
-static struct class *dax_class;
27
-
28
-/*
29
- * Rely on the fact that drvdata is set before the attributes are
30
- * registered, and that the attributes are unregistered before drvdata
31
- * is cleared to assume that drvdata is always valid.
32
- */
33
-static ssize_t id_show(struct device *dev,
34
- struct device_attribute *attr, char *buf)
35
-{
36
- struct dax_region *dax_region = dev_get_drvdata(dev);
37
-
38
- return sprintf(buf, "%d\n", dax_region->id);
39
-}
40
-static DEVICE_ATTR_RO(id);
41
-
42
-static ssize_t region_size_show(struct device *dev,
43
- struct device_attribute *attr, char *buf)
44
-{
45
- struct dax_region *dax_region = dev_get_drvdata(dev);
46
-
47
- return sprintf(buf, "%llu\n", (unsigned long long)
48
- resource_size(&dax_region->res));
49
-}
50
-static struct device_attribute dev_attr_region_size = __ATTR(size, 0444,
51
- region_size_show, NULL);
52
-
53
-static ssize_t align_show(struct device *dev,
54
- struct device_attribute *attr, char *buf)
55
-{
56
- struct dax_region *dax_region = dev_get_drvdata(dev);
57
-
58
- return sprintf(buf, "%u\n", dax_region->align);
59
-}
60
-static DEVICE_ATTR_RO(align);
61
-
62
-static struct attribute *dax_region_attributes[] = {
63
- &dev_attr_region_size.attr,
64
- &dev_attr_align.attr,
65
- &dev_attr_id.attr,
66
- NULL,
67
-};
68
-
69
-static const struct attribute_group dax_region_attribute_group = {
70
- .name = "dax_region",
71
- .attrs = dax_region_attributes,
72
-};
73
-
74
-static const struct attribute_group *dax_region_attribute_groups[] = {
75
- &dax_region_attribute_group,
76
- NULL,
77
-};
78
-
79
-static void dax_region_free(struct kref *kref)
80
-{
81
- struct dax_region *dax_region;
82
-
83
- dax_region = container_of(kref, struct dax_region, kref);
84
- kfree(dax_region);
85
-}
86
-
87
-void dax_region_put(struct dax_region *dax_region)
88
-{
89
- kref_put(&dax_region->kref, dax_region_free);
90
-}
91
-EXPORT_SYMBOL_GPL(dax_region_put);
92
-
93
-static void dax_region_unregister(void *region)
94
-{
95
- struct dax_region *dax_region = region;
96
-
97
- sysfs_remove_groups(&dax_region->dev->kobj,
98
- dax_region_attribute_groups);
99
- dax_region_put(dax_region);
100
-}
101
-
102
-struct dax_region *alloc_dax_region(struct device *parent, int region_id,
103
- struct resource *res, unsigned int align, void *addr,
104
- unsigned long pfn_flags)
105
-{
106
- struct dax_region *dax_region;
107
-
108
- /*
109
- * The DAX core assumes that it can store its private data in
110
- * parent->driver_data. This WARN is a reminder / safeguard for
111
- * developers of device-dax drivers.
112
- */
113
- if (dev_get_drvdata(parent)) {
114
- dev_WARN(parent, "dax core failed to setup private data\n");
115
- return NULL;
116
- }
117
-
118
- if (!IS_ALIGNED(res->start, align)
119
- || !IS_ALIGNED(resource_size(res), align))
120
- return NULL;
121
-
122
- dax_region = kzalloc(sizeof(*dax_region), GFP_KERNEL);
123
- if (!dax_region)
124
- return NULL;
125
-
126
- dev_set_drvdata(parent, dax_region);
127
- memcpy(&dax_region->res, res, sizeof(*res));
128
- dax_region->pfn_flags = pfn_flags;
129
- kref_init(&dax_region->kref);
130
- dax_region->id = region_id;
131
- ida_init(&dax_region->ida);
132
- dax_region->align = align;
133
- dax_region->dev = parent;
134
- dax_region->base = addr;
135
- if (sysfs_create_groups(&parent->kobj, dax_region_attribute_groups)) {
136
- kfree(dax_region);
137
- return NULL;
138
- }
139
-
140
- kref_get(&dax_region->kref);
141
- if (devm_add_action_or_reset(parent, dax_region_unregister, dax_region))
142
- return NULL;
143
- return dax_region;
144
-}
145
-EXPORT_SYMBOL_GPL(alloc_dax_region);
146
-
147
-static struct dev_dax *to_dev_dax(struct device *dev)
148
-{
149
- return container_of(dev, struct dev_dax, dev);
150
-}
151
-
152
-static ssize_t size_show(struct device *dev,
153
- struct device_attribute *attr, char *buf)
154
-{
155
- struct dev_dax *dev_dax = to_dev_dax(dev);
156
- unsigned long long size = 0;
157
- int i;
158
-
159
- for (i = 0; i < dev_dax->num_resources; i++)
160
- size += resource_size(&dev_dax->res[i]);
161
-
162
- return sprintf(buf, "%llu\n", size);
163
-}
164
-static DEVICE_ATTR_RO(size);
165
-
166
-static struct attribute *dev_dax_attributes[] = {
167
- &dev_attr_size.attr,
168
- NULL,
169
-};
170
-
171
-static const struct attribute_group dev_dax_attribute_group = {
172
- .attrs = dev_dax_attributes,
173
-};
174
-
175
-static const struct attribute_group *dax_attribute_groups[] = {
176
- &dev_dax_attribute_group,
177
- NULL,
178
-};
15
+#include "bus.h"
17916
18017 static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
18118 const char *func)
18219 {
183
- struct dax_region *dax_region = dev_dax->region;
18420 struct device *dev = &dev_dax->dev;
18521 unsigned long mask;
18622
....@@ -195,20 +31,12 @@
19531 return -EINVAL;
19632 }
19733
198
- mask = dax_region->align - 1;
34
+ mask = dev_dax->align - 1;
19935 if (vma->vm_start & mask || vma->vm_end & mask) {
20036 dev_info_ratelimited(dev,
20137 "%s: %s: fail, unaligned vma (%#lx - %#lx, %#lx)\n",
20238 current->comm, func, vma->vm_start, vma->vm_end,
20339 mask);
204
- return -EINVAL;
205
- }
206
-
207
- if ((dax_region->pfn_flags & (PFN_DEV|PFN_MAP)) == PFN_DEV
208
- && (vma->vm_flags & VM_DONTCOPY) == 0) {
209
- dev_info_ratelimited(dev,
210
- "%s: %s: fail, dax range requires MADV_DONTFORK\n",
211
- current->comm, func);
21240 return -EINVAL;
21341 }
21442
....@@ -226,25 +54,22 @@
22654 __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
22755 unsigned long size)
22856 {
229
- struct resource *res;
230
- /* gcc-4.6.3-nolibc for i386 complains that this is uninitialized */
231
- phys_addr_t uninitialized_var(phys);
23257 int i;
23358
234
- for (i = 0; i < dev_dax->num_resources; i++) {
235
- res = &dev_dax->res[i];
236
- phys = pgoff * PAGE_SIZE + res->start;
237
- if (phys >= res->start && phys <= res->end)
238
- break;
239
- pgoff -= PHYS_PFN(resource_size(res));
240
- }
59
+ for (i = 0; i < dev_dax->nr_range; i++) {
60
+ struct dev_dax_range *dax_range = &dev_dax->ranges[i];
61
+ struct range *range = &dax_range->range;
62
+ unsigned long long pgoff_end;
63
+ phys_addr_t phys;
24164
242
- if (i < dev_dax->num_resources) {
243
- res = &dev_dax->res[i];
244
- if (phys + size - 1 <= res->end)
65
+ pgoff_end = dax_range->pgoff + PHYS_PFN(range_len(range)) - 1;
66
+ if (pgoff < dax_range->pgoff || pgoff > pgoff_end)
67
+ continue;
68
+ phys = PFN_PHYS(pgoff - dax_range->pgoff) + range->start;
69
+ if (phys + size - 1 <= range->end)
24570 return phys;
71
+ break;
24672 }
247
-
24873 return -1;
24974 }
25075
....@@ -252,21 +77,19 @@
25277 struct vm_fault *vmf, pfn_t *pfn)
25378 {
25479 struct device *dev = &dev_dax->dev;
255
- struct dax_region *dax_region;
25680 phys_addr_t phys;
25781 unsigned int fault_size = PAGE_SIZE;
25882
25983 if (check_vma(dev_dax, vmf->vma, __func__))
26084 return VM_FAULT_SIGBUS;
26185
262
- dax_region = dev_dax->region;
263
- if (dax_region->align > PAGE_SIZE) {
86
+ if (dev_dax->align > PAGE_SIZE) {
26487 dev_dbg(dev, "alignment (%#x) > fault size (%#x)\n",
265
- dax_region->align, fault_size);
88
+ dev_dax->align, fault_size);
26689 return VM_FAULT_SIGBUS;
26790 }
26891
269
- if (fault_size != dax_region->align)
92
+ if (fault_size != dev_dax->align)
27093 return VM_FAULT_SIGBUS;
27194
27295 phys = dax_pgoff_to_phys(dev_dax, vmf->pgoff, PAGE_SIZE);
....@@ -275,7 +98,7 @@
27598 return VM_FAULT_SIGBUS;
27699 }
277100
278
- *pfn = phys_to_pfn_t(phys, dax_region->pfn_flags);
101
+ *pfn = phys_to_pfn_t(phys, PFN_DEV|PFN_MAP);
279102
280103 return vmf_insert_mixed(vmf->vma, vmf->address, *pfn);
281104 }
....@@ -285,7 +108,6 @@
285108 {
286109 unsigned long pmd_addr = vmf->address & PMD_MASK;
287110 struct device *dev = &dev_dax->dev;
288
- struct dax_region *dax_region;
289111 phys_addr_t phys;
290112 pgoff_t pgoff;
291113 unsigned int fault_size = PMD_SIZE;
....@@ -293,22 +115,15 @@
293115 if (check_vma(dev_dax, vmf->vma, __func__))
294116 return VM_FAULT_SIGBUS;
295117
296
- dax_region = dev_dax->region;
297
- if (dax_region->align > PMD_SIZE) {
118
+ if (dev_dax->align > PMD_SIZE) {
298119 dev_dbg(dev, "alignment (%#x) > fault size (%#x)\n",
299
- dax_region->align, fault_size);
120
+ dev_dax->align, fault_size);
300121 return VM_FAULT_SIGBUS;
301122 }
302123
303
- /* dax pmd mappings require pfn_t_devmap() */
304
- if ((dax_region->pfn_flags & (PFN_DEV|PFN_MAP)) != (PFN_DEV|PFN_MAP)) {
305
- dev_dbg(dev, "region lacks devmap flags\n");
124
+ if (fault_size < dev_dax->align)
306125 return VM_FAULT_SIGBUS;
307
- }
308
-
309
- if (fault_size < dax_region->align)
310
- return VM_FAULT_SIGBUS;
311
- else if (fault_size > dax_region->align)
126
+ else if (fault_size > dev_dax->align)
312127 return VM_FAULT_FALLBACK;
313128
314129 /* if we are outside of the VMA */
....@@ -323,7 +138,7 @@
323138 return VM_FAULT_SIGBUS;
324139 }
325140
326
- *pfn = phys_to_pfn_t(phys, dax_region->pfn_flags);
141
+ *pfn = phys_to_pfn_t(phys, PFN_DEV|PFN_MAP);
327142
328143 return vmf_insert_pfn_pmd(vmf, *pfn, vmf->flags & FAULT_FLAG_WRITE);
329144 }
....@@ -334,7 +149,6 @@
334149 {
335150 unsigned long pud_addr = vmf->address & PUD_MASK;
336151 struct device *dev = &dev_dax->dev;
337
- struct dax_region *dax_region;
338152 phys_addr_t phys;
339153 pgoff_t pgoff;
340154 unsigned int fault_size = PUD_SIZE;
....@@ -343,22 +157,15 @@
343157 if (check_vma(dev_dax, vmf->vma, __func__))
344158 return VM_FAULT_SIGBUS;
345159
346
- dax_region = dev_dax->region;
347
- if (dax_region->align > PUD_SIZE) {
160
+ if (dev_dax->align > PUD_SIZE) {
348161 dev_dbg(dev, "alignment (%#x) > fault size (%#x)\n",
349
- dax_region->align, fault_size);
162
+ dev_dax->align, fault_size);
350163 return VM_FAULT_SIGBUS;
351164 }
352165
353
- /* dax pud mappings require pfn_t_devmap() */
354
- if ((dax_region->pfn_flags & (PFN_DEV|PFN_MAP)) != (PFN_DEV|PFN_MAP)) {
355
- dev_dbg(dev, "region lacks devmap flags\n");
166
+ if (fault_size < dev_dax->align)
356167 return VM_FAULT_SIGBUS;
357
- }
358
-
359
- if (fault_size < dax_region->align)
360
- return VM_FAULT_SIGBUS;
361
- else if (fault_size > dax_region->align)
168
+ else if (fault_size > dev_dax->align)
362169 return VM_FAULT_FALLBACK;
363170
364171 /* if we are outside of the VMA */
....@@ -373,7 +180,7 @@
373180 return VM_FAULT_SIGBUS;
374181 }
375182
376
- *pfn = phys_to_pfn_t(phys, dax_region->pfn_flags);
183
+ *pfn = phys_to_pfn_t(phys, PFN_DEV|PFN_MAP);
377184
378185 return vmf_insert_pfn_pud(vmf, *pfn, vmf->flags & FAULT_FLAG_WRITE);
379186 }
....@@ -453,9 +260,8 @@
453260 {
454261 struct file *filp = vma->vm_file;
455262 struct dev_dax *dev_dax = filp->private_data;
456
- struct dax_region *dax_region = dev_dax->region;
457263
458
- if (!IS_ALIGNED(addr, dax_region->align))
264
+ if (!IS_ALIGNED(addr, dev_dax->align))
459265 return -EINVAL;
460266 return 0;
461267 }
....@@ -464,9 +270,8 @@
464270 {
465271 struct file *filp = vma->vm_file;
466272 struct dev_dax *dev_dax = filp->private_data;
467
- struct dax_region *dax_region = dev_dax->region;
468273
469
- return dax_region->align;
274
+ return dev_dax->align;
470275 }
471276
472277 static const struct vm_operations_struct dax_vm_ops = {
....@@ -505,13 +310,11 @@
505310 {
506311 unsigned long off, off_end, off_align, len_align, addr_align, align;
507312 struct dev_dax *dev_dax = filp ? filp->private_data : NULL;
508
- struct dax_region *dax_region;
509313
510314 if (!dev_dax || addr)
511315 goto out;
512316
513
- dax_region = dev_dax->region;
514
- align = dax_region->align;
317
+ align = dev_dax->align;
515318 off = pgoff << PAGE_SHIFT;
516319 off_end = off + len;
517320 off_align = round_up(off, align);
....@@ -550,6 +353,7 @@
550353 inode->i_mapping->a_ops = &dev_dax_aops;
551354 filp->f_mapping = inode->i_mapping;
552355 filp->f_wb_err = filemap_sample_wb_err(filp->f_mapping);
356
+ filp->f_sb_err = file_sample_sb_err(filp);
553357 filp->private_data = dev_dax;
554358 inode->i_flags = S_DAX;
555359
....@@ -574,152 +378,104 @@
574378 .mmap_supported_flags = MAP_SYNC,
575379 };
576380
577
-static void dev_dax_release(struct device *dev)
381
+static void dev_dax_cdev_del(void *cdev)
578382 {
579
- struct dev_dax *dev_dax = to_dev_dax(dev);
580
- struct dax_region *dax_region = dev_dax->region;
581
- struct dax_device *dax_dev = dev_dax->dax_dev;
582
-
583
- if (dev_dax->id >= 0)
584
- ida_simple_remove(&dax_region->ida, dev_dax->id);
585
- dax_region_put(dax_region);
586
- put_dax(dax_dev);
587
- kfree(dev_dax);
383
+ cdev_del(cdev);
588384 }
589385
590
-static void kill_dev_dax(struct dev_dax *dev_dax)
386
+static void dev_dax_kill(void *dev_dax)
591387 {
592
- struct dax_device *dax_dev = dev_dax->dax_dev;
593
- struct inode *inode = dax_inode(dax_dev);
594
-
595
- kill_dax(dax_dev);
596
- unmap_mapping_range(inode->i_mapping, 0, 0, 1);
597
-}
598
-
599
-static void unregister_dev_dax(void *dev)
600
-{
601
- struct dev_dax *dev_dax = to_dev_dax(dev);
602
- struct dax_device *dax_dev = dev_dax->dax_dev;
603
- struct inode *inode = dax_inode(dax_dev);
604
- struct cdev *cdev = inode->i_cdev;
605
-
606
- dev_dbg(dev, "trace\n");
607
-
608388 kill_dev_dax(dev_dax);
609
- cdev_device_del(cdev, dev);
610
- put_device(dev);
611389 }
612390
613
-struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
614
- int id, struct resource *res, int count)
391
+int dev_dax_probe(struct dev_dax *dev_dax)
615392 {
616
- struct device *parent = dax_region->dev;
617
- struct dax_device *dax_dev;
618
- struct dev_dax *dev_dax;
393
+ struct dax_device *dax_dev = dev_dax->dax_dev;
394
+ struct device *dev = &dev_dax->dev;
395
+ struct dev_pagemap *pgmap;
619396 struct inode *inode;
620
- struct device *dev;
621397 struct cdev *cdev;
398
+ void *addr;
622399 int rc, i;
623400
624
- if (!count)
625
- return ERR_PTR(-EINVAL);
401
+ pgmap = dev_dax->pgmap;
402
+ if (dev_WARN_ONCE(dev, pgmap && dev_dax->nr_range > 1,
403
+ "static pgmap / multi-range device conflict\n"))
404
+ return -EINVAL;
626405
627
- dev_dax = kzalloc(struct_size(dev_dax, res, count), GFP_KERNEL);
628
- if (!dev_dax)
629
- return ERR_PTR(-ENOMEM);
406
+ if (!pgmap) {
407
+ pgmap = devm_kzalloc(dev, sizeof(*pgmap) + sizeof(struct range)
408
+ * (dev_dax->nr_range - 1), GFP_KERNEL);
409
+ if (!pgmap)
410
+ return -ENOMEM;
411
+ pgmap->nr_range = dev_dax->nr_range;
412
+ }
630413
631
- for (i = 0; i < count; i++) {
632
- if (!IS_ALIGNED(res[i].start, dax_region->align)
633
- || !IS_ALIGNED(resource_size(&res[i]),
634
- dax_region->align)) {
635
- rc = -EINVAL;
636
- break;
414
+ for (i = 0; i < dev_dax->nr_range; i++) {
415
+ struct range *range = &dev_dax->ranges[i].range;
416
+
417
+ if (!devm_request_mem_region(dev, range->start,
418
+ range_len(range), dev_name(dev))) {
419
+ dev_warn(dev, "mapping%d: %#llx-%#llx could not reserve range\n",
420
+ i, range->start, range->end);
421
+ return -EBUSY;
637422 }
638
- dev_dax->res[i].start = res[i].start;
639
- dev_dax->res[i].end = res[i].end;
423
+ /* don't update the range for static pgmap */
424
+ if (!dev_dax->pgmap)
425
+ pgmap->ranges[i] = *range;
640426 }
641427
642
- if (i < count)
643
- goto err_id;
644
-
645
- if (id < 0) {
646
- id = ida_simple_get(&dax_region->ida, 0, 0, GFP_KERNEL);
647
- dev_dax->id = id;
648
- if (id < 0) {
649
- rc = id;
650
- goto err_id;
651
- }
652
- } else {
653
- /* region provider owns @id lifetime */
654
- dev_dax->id = -1;
655
- }
656
-
657
- /*
658
- * No 'host' or dax_operations since there is no access to this
659
- * device outside of mmap of the resulting character device.
660
- */
661
- dax_dev = alloc_dax(dev_dax, NULL, NULL);
662
- if (!dax_dev) {
663
- rc = -ENOMEM;
664
- goto err_dax;
665
- }
666
-
667
- /* from here on we're committed to teardown via dax_dev_release() */
668
- dev = &dev_dax->dev;
669
- device_initialize(dev);
428
+ pgmap->type = MEMORY_DEVICE_GENERIC;
429
+ addr = devm_memremap_pages(dev, pgmap);
430
+ if (IS_ERR(addr))
431
+ return PTR_ERR(addr);
670432
671433 inode = dax_inode(dax_dev);
672434 cdev = inode->i_cdev;
673435 cdev_init(cdev, &dax_fops);
674
- cdev->owner = parent->driver->owner;
675
-
676
- dev_dax->num_resources = count;
677
- dev_dax->dax_dev = dax_dev;
678
- dev_dax->region = dax_region;
679
- kref_get(&dax_region->kref);
680
-
681
- dev->devt = inode->i_rdev;
682
- dev->class = dax_class;
683
- dev->parent = parent;
684
- dev->groups = dax_attribute_groups;
685
- dev->release = dev_dax_release;
686
- dev_set_name(dev, "dax%d.%d", dax_region->id, id);
687
-
688
- rc = cdev_device_add(cdev, dev);
689
- if (rc) {
690
- kill_dev_dax(dev_dax);
691
- put_device(dev);
692
- return ERR_PTR(rc);
693
- }
694
-
695
- rc = devm_add_action_or_reset(dax_region->dev, unregister_dev_dax, dev);
436
+ if (dev->class) {
437
+ /* for the CONFIG_DEV_DAX_PMEM_COMPAT case */
438
+ cdev->owner = dev->parent->driver->owner;
439
+ } else
440
+ cdev->owner = dev->driver->owner;
441
+ cdev_set_parent(cdev, &dev->kobj);
442
+ rc = cdev_add(cdev, dev->devt, 1);
696443 if (rc)
697
- return ERR_PTR(rc);
444
+ return rc;
698445
699
- return dev_dax;
446
+ rc = devm_add_action_or_reset(dev, dev_dax_cdev_del, cdev);
447
+ if (rc)
448
+ return rc;
700449
701
- err_dax:
702
- if (dev_dax->id >= 0)
703
- ida_simple_remove(&dax_region->ida, dev_dax->id);
704
- err_id:
705
- kfree(dev_dax);
706
-
707
- return ERR_PTR(rc);
450
+ run_dax(dax_dev);
451
+ return devm_add_action_or_reset(dev, dev_dax_kill, dev_dax);
708452 }
709
-EXPORT_SYMBOL_GPL(devm_create_dev_dax);
453
+EXPORT_SYMBOL_GPL(dev_dax_probe);
454
+
455
+static int dev_dax_remove(struct dev_dax *dev_dax)
456
+{
457
+ /* all probe actions are unwound by devm */
458
+ return 0;
459
+}
460
+
461
+static struct dax_device_driver device_dax_driver = {
462
+ .probe = dev_dax_probe,
463
+ .remove = dev_dax_remove,
464
+ .match_always = 1,
465
+};
710466
711467 static int __init dax_init(void)
712468 {
713
- dax_class = class_create(THIS_MODULE, "dax");
714
- return PTR_ERR_OR_ZERO(dax_class);
469
+ return dax_driver_register(&device_dax_driver);
715470 }
716471
717472 static void __exit dax_exit(void)
718473 {
719
- class_destroy(dax_class);
474
+ dax_driver_unregister(&device_dax_driver);
720475 }
721476
722477 MODULE_AUTHOR("Intel Corporation");
723478 MODULE_LICENSE("GPL v2");
724
-subsys_initcall(dax_init);
479
+module_init(dax_init);
725480 module_exit(dax_exit);
481
+MODULE_ALIAS_DAX_DEVICE(0);