]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid()
authorRob Herring <robh@kernel.org>
Mon, 16 Apr 2018 16:58:16 +0000 (11:58 -0500)
committerDan Williams <dan.j.williams@intel.com>
Thu, 19 Apr 2018 22:07:10 +0000 (15:07 -0700)
Remove the direct dependency on of_node_to_nid() by using dev_to_node()
instead. Any DT platform device will have its NUMA node id set when the
device is created.

With this, commit 291717b6fbdb ("libnvdimm, of_pmem: workaround OF_NUMA=n
build error") can be reverted.

Fixes: 717197608952 ("libnvdimm: Add device-tree based driver")
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Oliver O'Halloran <oohall@gmail.com>
Cc: linux-nvdimm@lists.01.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/of_pmem.c

index 85013bad35de4e176f82f253723f91600c084ea3..0a701837dfc0b9bd6c011f5ee092feb101a15acb 100644 (file)
@@ -67,7 +67,7 @@ static int of_pmem_region_probe(struct platform_device *pdev)
                 */
                memset(&ndr_desc, 0, sizeof(ndr_desc));
                ndr_desc.attr_groups = region_attr_groups;
-               ndr_desc.numa_node = of_node_to_nid(np);
+               ndr_desc.numa_node = dev_to_node(&pdev->dev);
                ndr_desc.res = &pdev->resource[i];
                ndr_desc.of_node = np;
                set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);