All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid()
@ 2018-04-16 16:58 Rob Herring
  2018-04-16 17:29 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2018-04-16 16:58 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-nvdimm

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.

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>
---
 drivers/nvdimm/of_pmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c
index 85013bad35de..0a701837dfc0 100644
--- a/drivers/nvdimm/of_pmem.c
+++ b/drivers/nvdimm/of_pmem.c
@@ -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);
-- 
2.14.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid()
  2018-04-16 16:58 [PATCH] libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid() Rob Herring
@ 2018-04-16 17:29 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2018-04-16 17:29 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-nvdimm

On Mon, Apr 16, 2018 at 9:58 AM, Rob Herring <robh@kernel.org> wrote:
> 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.
>
> 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>
> ---
>  drivers/nvdimm/of_pmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c
> index 85013bad35de..0a701837dfc0 100644
> --- a/drivers/nvdimm/of_pmem.c
> +++ b/drivers/nvdimm/of_pmem.c
> @@ -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
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-16 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-16 16:58 [PATCH] libnvdimm, of_pmem: use dev_to_node() instead of of_node_to_nid() Rob Herring
2018-04-16 17:29 ` Dan Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.