public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Puneet Saxena <puneets@nvidia.com>
To: <robh+dt@kernel.org>, <pantelis.antoniou@konsulko.com>,
	<frowand.list@gmail.com>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <treding@nvidia.com>, <vdumpa@nvidia.com>, <snikam@nvidia.com>,
	<jonathanh@nvidia.com>, Puneet Saxena <puneets@nvidia.com>
Subject: [PATCH V2] of: reserved-memory: ignore disabled memory-region nodes
Date: Wed, 22 May 2019 16:17:11 +0530	[thread overview]
Message-ID: <1558522031-549-2-git-send-email-puneets@nvidia.com> (raw)
In-Reply-To: <1558522031-549-1-git-send-email-puneets@nvidia.com>

From: Krishna Reddy <vdumpa@nvidia.com>

Ignore disabled nodes in the memory-region 
nodes list and continue to initialize the rest 
of enabled nodes.

Check if the "reserved-memory" node is available
and if it's not available, return 0 to ignore the 
"reserved-memory" node and continue parsing with 
next node in memory-region nodes list.

Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
---
v2:
* Fixed typo in commit message.
* Used "of_device_is_available" to check "reserved-memory"
  nodes are disabled/enabled.

 drivers/of/of_reserved_mem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 1977ee0adcb1..b0b7a0c4431d 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -322,6 +322,9 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
 	if (!target)
 		return -ENODEV;
 
+	if (!of_device_is_available(target))
+		return 0;
+
 	rmem = __find_rmem(target);
 	of_node_put(target);
 
-- 
2.7.4


  reply	other threads:[~2019-05-22 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 10:47 [PATCH] ignore disabled memory-region nodes Puneet Saxena
2019-05-22 10:47 ` Puneet Saxena [this message]
2019-05-24 20:53   ` [PATCH V2] of: reserved-memory: " Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1558522031-549-2-git-send-email-puneets@nvidia.com \
    --to=puneets@nvidia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=robh+dt@kernel.org \
    --cc=snikam@nvidia.com \
    --cc=treding@nvidia.com \
    --cc=vdumpa@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox