From patchwork Thu Sep 6 12:12:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1414001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id ADE11DFFCF for ; Thu, 6 Sep 2012 12:19:26 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9azL-0002kf-Ev; Thu, 06 Sep 2012 12:15:16 +0000 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T9aww-0001E8-1B for linux-arm-kernel@lists.infradead.org; Thu, 06 Sep 2012 12:12:47 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKUEiTPBm+R7VXogYFFS3beY/I6LTh526N@postini.com; Thu, 06 Sep 2012 05:12:45 PDT Received: by obbta17 with SMTP id ta17so2325590obb.36 for ; Thu, 06 Sep 2012 05:12:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=wdi6I+B8cVDedo7PlkwvlV4teOirxB0Kx1EYf6rnvYk=; b=bmk5mUa9rAIhC2i9bXsNGed5WeRFO7D+ywGtww9vJh2K2TVlyv8kECtPE0V9pi446D /gHyLTcyC0Ic5RW73z0h7pKIF4TL6Ak+FqisKUMiK7AFwnTuRR5qcDtC9jFtSmf6Xmau wINoYhxJH12DvS+k9/wigqfVDPz1HQu/IFkF1vvwPFZzqg+3uYjMSL4D9uZ6sxC6AHGi yPXO3BGPvS6ZdzLhoQWvidvV9sMsVovD+YNswGAKudDcg+I2V4PdM3L/xBUvGqGNptn6 1nK4fsjo+jJL1XRqPDgEYMR08qaqaq8FkzZQxah/sRmpCz2ebYozdx69zmTiY758PZey vNgw== Received: by 10.60.30.201 with SMTP id u9mr1673595oeh.51.1346933563798; Thu, 06 Sep 2012 05:12:43 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id zn9sm1795856obb.23.2012.09.06.05.12.40 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 05:12:43 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Samuel Ortiz , Dmitry Torokhov , Grant Likely , Rob Herring Subject: [PATCH v3 12/14] ASoC: twl4030: Convert to use devm_kzalloc Date: Thu, 6 Sep 2012 15:12:19 +0300 Message-Id: <1346933541-21547-13-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1346933541-21547-1-git-send-email-peter.ujfalusi@ti.com> References: <1346933541-21547-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQmB8WOrW4hfPS1x7giSNss0NXhqAws5LoLGhuXwssINH75W1ZsgXjW6NCk3nOWs6EyMnupz X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.203 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: alsa-devel@alsa-project.org, Benoit Cousson , devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, Tero Kristo , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Allocate the private data with devm_kzalloc. Signed-off-by: Peter Ujfalusi --- sound/soc/codecs/twl4030.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 27ccea4..413e698 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -2231,7 +2231,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec) { struct twl4030_priv *twl4030; - twl4030 = kzalloc(sizeof(struct twl4030_priv), GFP_KERNEL); + twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv), + GFP_KERNEL); if (twl4030 == NULL) { dev_err(codec->dev, "Can not allocate memory\n"); return -ENOMEM; @@ -2253,7 +2254,6 @@ static int twl4030_soc_remove(struct snd_soc_codec *codec) /* Reset registers to their chip default before leaving */ twl4030_reset_registers(codec); twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); - kfree(twl4030); if (pdata && pdata->hs_extmute && gpio_is_valid(pdata->hs_extmute_gpio)) gpio_free(pdata->hs_extmute_gpio);