From patchwork Fri May 23 06:24:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4228321 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 3F4AFBF90B for ; Fri, 23 May 2014 06:25:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E9BF2038F for ; Fri, 23 May 2014 06:25:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C6318202DD for ; Fri, 23 May 2014 06:25:22 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E52952656B9; Fri, 23 May 2014 08:25:21 +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 E4DA6265645; Fri, 23 May 2014 08:25:10 +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 48A6926564D; Fri, 23 May 2014 08:25:09 +0200 (CEST) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by alsa0.perex.cz (Postfix) with ESMTP id E79A5265634 for ; Fri, 23 May 2014 08:25:00 +0200 (CEST) Received: by mail-pb0-f50.google.com with SMTP id ma3so3683134pbc.37 for ; Thu, 22 May 2014 23:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type; bh=wGUOhN56RtnkNGR4/Epg8XZOnwO4bOk6jznko/e2uds=; b=ScsivRE6OdXJ9EapInS4CPnycPkrh04Ijn9TqsE1Lr1AQNbmzGYe0suv8DQNznkG34 8XiyIsS2Jzq8EQ6eA3+GOT/5IHp/dyDjxRkkXZEnUaNl+891F13bxWpXpsxlIuFbTWdu BjndhGdW/TTP6paqHbbjXrduvHPoDu38kVEsGLu0nbLsOBHdjwskJoKk8Xu9UUdKz4b5 RXTqGa+p/7qWNE3L7nPsHlAF836f6rs6cR0+C9BrAcFrNHmZ6+Ryi6n3yWjLcHI3zNBA 0GcIXPpcVgeZOntawG/1yPyWHr0efO5CW4BLrcx04J/ftxTQFRhrmNpVd+ICahHoQDX4 QBUQ== X-Received: by 10.67.4.195 with SMTP id cg3mr3105618pad.21.1400826299595; Thu, 22 May 2014 23:24:59 -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 wn6sm9511224pab.18.2014.05.22.23.24.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 23:24:59 -0700 (PDT) Date: Thu, 22 May 2014 23:24:59 -0700 (PDT) Message-ID: <87oaypc8qu.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Mark Brown In-Reply-To: <87r43lc8w5.wl%kuninori.morimoto.gx@gmail.com> References: <87r43lc8w5.wl%kuninori.morimoto.gx@gmail.com> User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 1/6] ASoC: rsnd: DT node clean up by using the of_node_put() 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 Driver needs to call of_node_put() after of_get_chile_by_name() Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/src.c | 7 +++++-- sound/soc/sh/rcar/ssi.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 7da87cd..61009c4 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -598,18 +598,21 @@ static void rsnd_of_parse_src(struct platform_device *pdev, nr = of_get_child_count(src_node); if (!nr) - return; + goto rsnd_of_parse_src_end; src_info = devm_kzalloc(dev, sizeof(struct rsnd_src_platform_info) * nr, GFP_KERNEL); if (!src_info) { dev_err(dev, "src info allocation error\n"); - return; + goto rsnd_of_parse_src_end; } info->src_info = src_info; info->src_info_nr = nr; + +rsnd_of_parse_src_end: + of_node_put(src_node); } int rsnd_src_probe(struct platform_device *pdev, diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 4b13edb..ea8d4e7 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -554,14 +554,14 @@ static void rsnd_of_parse_ssi(struct platform_device *pdev, nr = of_get_child_count(node); if (!nr) - return; + goto rsnd_of_parse_ssi_end; ssi_info = devm_kzalloc(dev, sizeof(struct rsnd_ssi_platform_info) * nr, GFP_KERNEL); if (!ssi_info) { dev_err(dev, "ssi info allocation error\n"); - return; + goto rsnd_of_parse_ssi_end; } info->ssi_info = ssi_info; @@ -584,6 +584,9 @@ static void rsnd_of_parse_ssi(struct platform_device *pdev, */ ssi_info->pio_irq = irq_of_parse_and_map(np, 0); } + +rsnd_of_parse_ssi_end: + of_node_put(node); } int rsnd_ssi_probe(struct platform_device *pdev,