All of lore.kernel.org
 help / color / mirror / Atom feed
From: robin.murphy@arm.com (Robin Murphy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] bus/arm-cci: Streamline devicetree handling a bit
Date: Mon,  5 Feb 2018 18:39:45 +0000	[thread overview]
Message-ID: <1f61837990c42120112501602b6a87766b80c347.1517855839.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1517855839.git.robin.murphy@arm.com>

Rather than iterating over child nodes explicitly testing for
availability, we can just use the other helper which already subsumes
that check. Also, the availability check is already NULL-safe, so get
rid of a redundant check in cci_probe(), too.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/bus/arm-cci.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index bbc5bc5f172a..e9995e6a1b29 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -447,13 +447,10 @@ static int cci_probe_ports(struct device_node *np)
 	if (!ports)
 		return -ENOMEM;
 
-	for_each_child_of_node(np, cp) {
+	for_each_available_child_of_node(np, cp) {
 		if (!of_match_node(arm_cci_ctrl_if_matches, cp))
 			continue;
 
-		if (!of_device_is_available(cp))
-			continue;
-
 		i = nb_ace + nb_ace_lite;
 
 		if (i >= nb_cci_ports)
@@ -533,7 +530,7 @@ static int cci_probe(void)
 	struct resource res;
 
 	np = of_find_matching_node(NULL, arm_cci_matches);
-	if(!np || !of_device_is_available(np))
+	if (!of_device_is_available(np))
 		return -ENODEV;
 
 	ret = of_address_to_resource(np, 0, &res);
-- 
2.16.1.dirty

  parent reply	other threads:[~2018-02-05 18:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 18:39 [PATCH 0/5] Arm interconnect PMU driver tidyup Robin Murphy
2018-02-05 18:39 ` [PATCH 1/5] drivers/bus: Move Arm CCN PMU driver Robin Murphy
2018-02-05 18:39 ` [PATCH 2/5] drivers/bus: Split Arm CCI driver Robin Murphy
2018-02-07 12:22   ` Punit Agrawal
2018-02-07 13:07     ` Robin Murphy
2018-02-14 11:51       ` Will Deacon
2018-02-14 12:07         ` Robin Murphy
2018-02-14 14:28         ` Robin Murphy
2018-02-15 13:01           ` Will Deacon
2018-02-15 16:38             ` Robin Murphy
2018-02-05 18:39 ` [PATCH 3/5] perf/arm-cci: Simplify CPU hotplug Robin Murphy
2018-02-05 18:39 ` Robin Murphy [this message]
2018-02-05 18:39 ` [PATCH 5/5] perf/arm-cci: Clean up model discovery Robin Murphy
2018-02-15 13:00 ` [PATCH 0/5] Arm interconnect PMU driver tidyup Will Deacon

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=1f61837990c42120112501602b6a87766b80c347.1517855839.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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.