libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid()
PATCH 1/1 libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid()
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.
--- drivers/nvdimm/of_pmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvdimm/of_pmem.c +1 -1
@@ -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);
Signature · 6 lines
2.14.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 20 lines · Rob Herring
Remove the direct dependency on
of_node_to_nid()by usingdev_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.Cc Dan Williams <[email protected]>Cc Oliver O'Halloran <[email protected]>Signed-off-by Rob Herring <[email protected]>--- drivers/nvdimm/of_pmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nvdimm/of_pmem.c +0
-0
drivers/nvdimm/of_pmem.c static int of_pmem_region_probe(struct platform_device *pdev) · line 73
Quoted 8 lines
drivers/nvdimm/of_pmem.c +1
-1@@ -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);
Thanks Rob, we'll get this queued up for 4.17-rc2.
_______________________________________________
Linux-nvdimm mailing list [email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm