| .. | .. |
|---|
| 9 | 9 | #include <linux/ioport.h> |
|---|
| 10 | 10 | #include <linux/slab.h> |
|---|
| 11 | 11 | |
|---|
| 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 | | - |
|---|
| 23 | 12 | struct of_pmem_private { |
|---|
| 24 | 13 | struct nvdimm_bus_descriptor bus_desc; |
|---|
| 25 | 14 | struct nvdimm_bus *bus; |
|---|
| .. | .. |
|---|
| 41 | 30 | if (!priv) |
|---|
| 42 | 31 | return -ENOMEM; |
|---|
| 43 | 32 | |
|---|
| 44 | | - priv->bus_desc.attr_groups = bus_attr_groups; |
|---|
| 45 | 33 | priv->bus_desc.provider_name = kstrdup(pdev->name, GFP_KERNEL); |
|---|
| 46 | 34 | priv->bus_desc.module = THIS_MODULE; |
|---|
| 47 | 35 | priv->bus_desc.of_node = np; |
|---|
| .. | .. |
|---|
| 66 | 54 | * structures so passing a stack pointer is fine. |
|---|
| 67 | 55 | */ |
|---|
| 68 | 56 | memset(&ndr_desc, 0, sizeof(ndr_desc)); |
|---|
| 69 | | - ndr_desc.attr_groups = region_attr_groups; |
|---|
| 70 | 57 | ndr_desc.numa_node = dev_to_node(&pdev->dev); |
|---|
| 58 | + ndr_desc.target_node = ndr_desc.numa_node; |
|---|
| 71 | 59 | ndr_desc.res = &pdev->resource[i]; |
|---|
| 72 | 60 | ndr_desc.of_node = np; |
|---|
| 73 | 61 | set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags); |
|---|
| 74 | 62 | |
|---|
| 75 | 63 | if (is_volatile) |
|---|
| 76 | 64 | region = nvdimm_volatile_region_create(bus, &ndr_desc); |
|---|
| 77 | | - else |
|---|
| 65 | + else { |
|---|
| 66 | + set_bit(ND_REGION_PERSIST_MEMCTRL, &ndr_desc.flags); |
|---|
| 78 | 67 | region = nvdimm_pmem_region_create(bus, &ndr_desc); |
|---|
| 68 | + } |
|---|
| 79 | 69 | |
|---|
| 80 | 70 | if (!region) |
|---|
| 81 | 71 | dev_warn(&pdev->dev, "Unable to register region %pR from %pOF\n", |
|---|
| .. | .. |
|---|
| 100 | 90 | |
|---|
| 101 | 91 | static const struct of_device_id of_pmem_region_match[] = { |
|---|
| 102 | 92 | { .compatible = "pmem-region" }, |
|---|
| 93 | + { .compatible = "pmem-region-v2" }, |
|---|
| 103 | 94 | { }, |
|---|
| 104 | 95 | }; |
|---|
| 105 | 96 | |
|---|