From patchwork Wed Aug 20 07:09:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4748701 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A6ADC0338 for ; Wed, 20 Aug 2014 09:57:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D252D20109 for ; Wed, 20 Aug 2014 09:57:57 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9B27320108 for ; Wed, 20 Aug 2014 09:57:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 01425265808; Wed, 20 Aug 2014 11:57:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A5DA12658E7; Wed, 20 Aug 2014 11:51:12 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BA98F265948; Wed, 20 Aug 2014 11:51:11 +0200 (CEST) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by alsa0.perex.cz (Postfix) with ESMTP id AFA2A2658E7 for ; Wed, 20 Aug 2014 11:46:25 +0200 (CEST) Received: by mail-pd0-f170.google.com with SMTP id g10so11555547pdj.29 for ; Wed, 20 Aug 2014 02:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=ni6052sLTFQ8aGX1FFGYOjwUw4p7jgY1XiG4TMx+Fdk=; b=GesIuthezrWPRgEVWY2NZyD6KoybyOjeoaixUrq3LD6waiXNwoSbAWHNQjeZ1o4q5P WdGMy5JIymmy7Pba5QTu1HxhBL956yoJa6uy2EEevtQ9u/ep7WrF1ZSEonI0a97gn+0k K9Cu9ambaiiyMlRQYsDuj8JsIIX37mjZItzSAcS81ttZzo37cg75Y09N/L2ARLsn5JIk UO4xrWCjb0To8E016JcqbezCFzTJKn35nvJDbHnlWjnXz53moL46frifV+WKWFj4AmE0 ltuR6A/wWXEtNjwpyhVsR+pQUJ8lJwn4fYYb3/ZQ1QbowBmDYWo06EjHGUUw36SwG0V+ K3/w== X-Received: by 10.68.241.138 with SMTP id wi10mr35776100pbc.126.1408518574020; Wed, 20 Aug 2014 00:09:34 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id h17sm32706435pdj.52.2014.08.20.00.09.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Aug 2014 00:09:33 -0700 (PDT) Date: Wed, 20 Aug 2014 00:09:33 -0700 (PDT) Message-ID: <87a96ziqms.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87fvgriqrb.wl%kuninori.morimoto.gx@gmail.com> References: <87fvgriqrb.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: devicetree@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 4/8] ASoC: simple-card: use common for_each_child_of_node() for loop X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index de6e631..60d277a 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -346,8 +346,9 @@ static int asoc_simple_card_parse_of(struct device_node *node, if (multi) { struct device_node *np = NULL; - int i; - for (i = 0; (np = of_get_next_child(node, np)); i++) { + int i = 0; + + for_each_child_of_node(node, np) { dev_dbg(dev, "\tlink %d:\n", i); ret = asoc_simple_card_dai_link_of(np, dev, dai_link + i, @@ -357,6 +358,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, of_node_put(np); return ret; } + i++; } } else { ret = asoc_simple_card_dai_link_of(node, dev,