hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/nvdimm/of_pmem.c
....@@ -9,17 +9,6 @@
99 #include <linux/ioport.h>
1010 #include <linux/slab.h>
1111
12
-static const struct attribute_group *region_attr_groups[] = {
13
- &nd_region_attribute_group,
14
- &nd_device_attribute_group,
15
- NULL,
16
-};
17
-
18
-static const struct attribute_group *bus_attr_groups[] = {
19
- &nvdimm_bus_attribute_group,
20
- NULL,
21
-};
22
-
2312 struct of_pmem_private {
2413 struct nvdimm_bus_descriptor bus_desc;
2514 struct nvdimm_bus *bus;
....@@ -41,7 +30,6 @@
4130 if (!priv)
4231 return -ENOMEM;
4332
44
- priv->bus_desc.attr_groups = bus_attr_groups;
4533 priv->bus_desc.provider_name = kstrdup(pdev->name, GFP_KERNEL);
4634 priv->bus_desc.module = THIS_MODULE;
4735 priv->bus_desc.of_node = np;
....@@ -66,16 +54,18 @@
6654 * structures so passing a stack pointer is fine.
6755 */
6856 memset(&ndr_desc, 0, sizeof(ndr_desc));
69
- ndr_desc.attr_groups = region_attr_groups;
7057 ndr_desc.numa_node = dev_to_node(&pdev->dev);
58
+ ndr_desc.target_node = ndr_desc.numa_node;
7159 ndr_desc.res = &pdev->resource[i];
7260 ndr_desc.of_node = np;
7361 set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);
7462
7563 if (is_volatile)
7664 region = nvdimm_volatile_region_create(bus, &ndr_desc);
77
- else
65
+ else {
66
+ set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc.flags);
7867 region = nvdimm_pmem_region_create(bus, &ndr_desc);
68
+ }
7969
8070 if (!region)
8171 dev_warn(&pdev->dev, "Unable to register region %pR from %pOF\n",
....@@ -100,6 +90,7 @@
10090
10191 static const struct of_device_id of_pmem_region_match[] = {
10292 { .compatible = "pmem-region" },
93
+ { .compatible = "pmem-region-v2" },
10394 { },
10495 };
10596