hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/nvdimm/dax_devs.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright(c) 2013-2016 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.
124 */
135 #include <linux/device.h>
146 #include <linux/sizes.h>
....@@ -31,17 +23,6 @@
3123 kfree(nd_dax);
3224 }
3325
34
-static struct device_type nd_dax_device_type = {
35
- .name = "nd_dax",
36
- .release = nd_dax_release,
37
-};
38
-
39
-bool is_nd_dax(struct device *dev)
40
-{
41
- return dev ? dev->type == &nd_dax_device_type : false;
42
-}
43
-EXPORT_SYMBOL(is_nd_dax);
44
-
4526 struct nd_dax *to_nd_dax(struct device *dev)
4627 {
4728 struct nd_dax *nd_dax = container_of(dev, struct nd_dax, nd_pfn.dev);
....@@ -51,12 +32,17 @@
5132 }
5233 EXPORT_SYMBOL(to_nd_dax);
5334
54
-static const struct attribute_group *nd_dax_attribute_groups[] = {
55
- &nd_pfn_attribute_group,
56
- &nd_device_attribute_group,
57
- &nd_numa_attribute_group,
58
- NULL,
35
+static const struct device_type nd_dax_device_type = {
36
+ .name = "nd_dax",
37
+ .release = nd_dax_release,
38
+ .groups = nd_pfn_attribute_groups,
5939 };
40
+
41
+bool is_nd_dax(struct device *dev)
42
+{
43
+ return dev ? dev->type == &nd_dax_device_type : false;
44
+}
45
+EXPORT_SYMBOL(is_nd_dax);
6046
6147 static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region)
6248 {
....@@ -77,7 +63,6 @@
7763
7864 dev = &nd_pfn->dev;
7965 dev_set_name(dev, "dax%d.%d", nd_region->id, nd_pfn->id);
80
- dev->groups = nd_dax_attribute_groups;
8166 dev->type = &nd_dax_device_type;
8267 dev->parent = &nd_region->dev;
8368