From patchwork Tue Sep 18 07:10:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas KANDAGATLA X-Patchwork-Id: 184637 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 74CE42C0736 for ; Tue, 18 Sep 2012 17:16:22 +1000 (EST) Received: from eu1sys200aog115.obsmtp.com (eu1sys200aog115.obsmtp.com [207.126.144.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5E2ED2C011A; Tue, 18 Sep 2012 17:14:23 +1000 (EST) Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUFgfSNAfT6q3Gyz26bMnxBMuye4LYjdm@postini.com; Tue, 18 Sep 2012 07:14:28 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3D357209; Tue, 18 Sep 2012 07:14:15 +0000 (GMT) Received: from mail7.sgp.st.com (mail7.sgp.st.com [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D421A23CA; Tue, 18 Sep 2012 07:14:14 +0000 (GMT) Received: from localhost (king.bri.st.com [10.65.51.147]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id ANO05671 (AUTH srinivak); Tue, 18 Sep 2012 09:14:14 +0200 From: Srinivas KANDAGATLA To: benh@kernel.crashing.org Subject: [PATCH v4 3/5] dt/powerpc/sysdev: Use of_get_child_by_name to get a named child Date: Tue, 18 Sep 2012 08:10:42 +0100 Message-Id: <1347952242-24638-1-git-send-email-srinivas.kandagatla@st.com> X-Mailer: git-send-email 1.7.0.4 Cc: kgene.kim@samsung.com, srinivas.kandagatla@st.com, devicetree-discuss@lists.ozlabs.org, broonie@opensource.wolfsonmicro.com, robherring2@gmail.com, ben-linux@fluff.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Srinivas Kandagatla As follow-up to "dt: introduce of_get_child_by_name to get child node by name." patch, This patch removes some of the code duplication in the driver by replacing it with of_get_child_by_name instead. Signed-off-by: Srinivas Kandagatla --- arch/powerpc/sysdev/qe_lib/qe.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index b043675..d094e51 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c @@ -568,10 +568,7 @@ struct qe_firmware_info *qe_get_firmware_info(void) } /* Find the 'firmware' child node */ - for_each_child_of_node(qe, fw) { - if (strcmp(fw->name, "firmware") == 0) - break; - } + fw = of_get_child_by_name(qe, "firmware"); of_node_put(qe);