From patchwork Mon Sep 10 10:46:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1431631 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 B921FDF28C for ; Mon, 10 Sep 2012 10:53:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TB1Ys-0005Zn-Bz; Mon, 10 Sep 2012 10:49:51 +0000 Received: from na3sys009aog109.obsmtp.com ([74.125.149.201]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1TB1Vy-0003pp-NN for linux-arm-kernel@lists.infradead.org; Mon, 10 Sep 2012 10:46:51 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) (using TLSv1) by na3sys009aob109.postini.com ([74.125.148.12]) with SMTP ID DSNKUE3FGVEsd5kTJzfo6rg3XxDi1UL22jJi@postini.com; Mon, 10 Sep 2012 03:46:50 PDT Received: by obbta17 with SMTP id ta17so2846225obb.36 for ; Mon, 10 Sep 2012 03:46:48 -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=TaSrw+unSz7j7W9RuHf9KYkC9RY5JmzCwhscvIEmGNHb3oI2FfuwdemuKF4QwYFQIA vPDhB6FXZ/wISgGQK7V+644KfTxOCVClb4LVYyQNAxjM88eL00V6IgUtOWlfIcFyK2tZ p7jBnx2G0iArloYb5S7V9DJ/F3OFUEJZ/If3hnzzdqQ/PcaHBOkdmiKmKRMXsX7b4gRb 6V+icgAZ1oBvnDzHEh61tdMsw2zl+WDrWs28u6gjtvhfWOg4UKBAK+8v0QK0NPkPL562 PizHT8Qz5cmuuLop96ov1p1FXrHh5Gy/6zbcYdQqhrEBFxVl8QEv0qS6kUH94307aEmk 1Xig== Received: by 10.60.29.228 with SMTP id n4mr13897385oeh.27.1347274008646; Mon, 10 Sep 2012 03:46:48 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id 5sm8888098oeq.4.2012.09.10.03.46.45 (version=SSLv3 cipher=OTHER); Mon, 10 Sep 2012 03:46:48 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Samuel Ortiz , Dmitry Torokhov , Grant Likely , Rob Herring Subject: [PATCH v4 12/14] ASoC: twl4030: Convert to use devm_kzalloc Date: Mon, 10 Sep 2012 13:46:30 +0300 Message-Id: <1347273992-9107-13-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347273992-9107-1-git-send-email-peter.ujfalusi@ti.com> References: <1347273992-9107-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQmK4M8DrlOhbTxFXX7Qk4u+THpkySsM6zIs+02Tp2ACdZ6cMPzAh2EVUeDfB8F+IHpM+oe1 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.201 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);