From patchwork Thu Aug 28 03:08:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4812641 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 7E673C0338 for ; Fri, 29 Aug 2014 21:46:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAA5120122 for ; Fri, 29 Aug 2014 21:46:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8507D2011B for ; Fri, 29 Aug 2014 21:46:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 804B226587C; Fri, 29 Aug 2014 23:46:38 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 5C3B6265996; Fri, 29 Aug 2014 16:07:07 +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 20ACC265997; Fri, 29 Aug 2014 16:07:06 +0200 (CEST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by alsa0.perex.cz (Postfix) with ESMTP id F22E2265A42 for ; Thu, 28 Aug 2014 05:08:48 +0200 (CEST) Received: by mail-pa0-f46.google.com with SMTP id eu11so647215pac.33 for ; Wed, 27 Aug 2014 20:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=l9BabJvBMcFho/sb6Si9Oh33tfjhrUmzwXGf0+mySgI=; b=AVmljAOZL70LDq191jO14dsA++0DHCHMjGTXL91l4zKNEpGBPxxmDU5DtVc+iVRU/e o5lhVh4jDtSe15eXdKNU7+AYvJZUwz6C8pnJytr9OlZ/bV7eZoBTFT4U+zHnDHC5wYCD HTXeh+9MuHiiwmeGBDKRWtVHWAX5lTwDyx16j5UAWWuFxiaKVLbufFp8L3dlaL1xr4LN O7JhEyLkMRcbykPISfFDUIwugX94gZtOdZK36+dVslT5ann+HoTKPRg82XBbXGXOFRoB +bkfOu4obw/UKTGXywx5Sxqj8omTwGYS9vh0y34hq9RnxrvpacibwAEv9YEr428zb1Gu HXtg== X-Received: by 10.70.89.43 with SMTP id bl11mr605628pdb.163.1409195327675; Wed, 27 Aug 2014 20:08:47 -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 mx3sm2989800pdb.81.2014.08.27.20.08.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Aug 2014 20:08:47 -0700 (PDT) Date: Wed, 27 Aug 2014 20:08:47 -0700 (PDT) Message-ID: <87zjepgvk3.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <8761hdia86.wl%kuninori.morimoto.gx@gmail.com> References: <87fvgriqrb.wl%kuninori.morimoto.gx@gmail.com> <8761hdia86.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH 4/4 v2] 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 --- v1 -> v2 - no change 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 8902704..fd8b045 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,