From patchwork Thu Feb 15 18:51:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 10223267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 127116055C for ; Thu, 15 Feb 2018 18:53:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02FB7262FF for ; Thu, 15 Feb 2018 18:53:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB6652847A; Thu, 15 Feb 2018 18:53:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6599F262FF for ; Thu, 15 Feb 2018 18:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9ZhRJZZKSIsS9iCRGOFUCmKKq8Je/V+KWHB78OMZM2o=; b=t3iUg2rDA0Wdf6YRrvtzMHgko8 01KeNHEgXoxUl34LS/zI8t/QSRjcC6FT+3/z+aM06uSn25T8ZPCic9psPB9TLjFQLftF+PkIEaLH1 9vLUarugJPzp6jp2nqwPHbnTa/5n8gK0ebK2qq3B27D6U/r08yhMwjk1RJsrxVrVN1GD+5YfPma7P lztXrOGEjIMXsaeyY/JTIPvwb31xI1SfteiCEYtrfY7aeXk6WxF2pYJmLrS3xf06D7Z0yp9rckcHF +FZsc8tEuyoAqoe1z24XQXkruC5oH+Uiqvv1J1A5JSay+y6ROOf8yxe1lvy3/1wKX1j6D1mKYvK5H 625vjdsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1emOeQ-0008Ta-I7; Thu, 15 Feb 2018 18:52:58 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1emOdV-000805-Rx for linux-arm-kernel@lists.infradead.org; Thu, 15 Feb 2018 18:52:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5DA39164F; Thu, 15 Feb 2018 10:51:57 -0800 (PST) Received: from e110467-lin.cambridge.arm.com (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 450913F487; Thu, 15 Feb 2018 10:51:56 -0800 (PST) From: Robin Murphy To: arm@kernel.org Subject: [PATCH v2 4/6] bus/arm-cci: Streamline devicetree handling a bit Date: Thu, 15 Feb 2018 18:51:44 +0000 Message-Id: X-Mailer: git-send-email 2.16.1.dirty In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180215_105201_969885_77781878 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org, pawel.moll@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Acked-by: Punit Agrawal Acked-by: Will Deacon Signed-off-by: Robin Murphy --- 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 503c1789dd02..23dc0b890d0c 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -448,13 +448,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) @@ -534,7 +531,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);