From patchwork Wed Aug 8 09:41:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1293851 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C07DB3FC23 for ; Wed, 8 Aug 2012 09:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932562Ab2HHJnL (ORCPT ); Wed, 8 Aug 2012 05:43:11 -0400 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:34349 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030292Ab2HHJmL (ORCPT ); Wed, 8 Aug 2012 05:42:11 -0400 Received: from mail-ob0-f171.google.com ([209.85.214.171]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKUCI0c0E7N68sChVwHl/SSviJwHGzTZOR@postini.com; Wed, 08 Aug 2012 02:42:11 PDT Received: by obqv19 with SMTP id v19so959998obq.2 for ; Wed, 08 Aug 2012 02:42:08 -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=poDLwbG7hd78QXhZ8fPMJD6IT6i51aP0Y1uVQd5/5X0=; b=eot6dl/DGSpgeZ9vTFD77RXwp0PerjRPfh25G+ySVJarev9CDz7tsJulJ0iNwbG06X EtIpUuW4w8cVIBfvGDVB0rtZAoPi0yVilkPkPBD7btS4YQQwNWdFA9CPPL8kdSiMhZeG y2l0OSKdfflKovVV8aFaztHG20VRlmsjwzNwfdctIvPrrcXvRc7gYTb7hb1uDvDDV1su OYVY+UhpIi4DYl/ALYVCldYLnFXXaTZQZ5B2xXPTBaOR9XXg7rdDmV4DHWbgOAkp9v6e BDS50gRR9cVMrElzM9qCYxOQYNHDuCInNp8hfXP2ioL9VZp5pp70IlMsWZ3p8YUpH/yY zFKA== Received: by 10.182.51.65 with SMTP id i1mr1906548obo.45.1344418928817; Wed, 08 Aug 2012 02:42:08 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id c6sm22141308obn.13.2012.08.08.02.42.05 (version=SSLv3 cipher=OTHER); Wed, 08 Aug 2012 02:42:08 -0700 (PDT) From: Peter Ujfalusi To: Samuel Ortiz , Mark Brown , Liam Girdwood , Tony Lindgren , Dmitry Torokhov Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Benoit Cousson Subject: [PATCH 09/11] ASoC: twl4030: Convert to use devm_kzalloc Date: Wed, 8 Aug 2012 12:41:25 +0300 Message-Id: <1344418887-5262-10-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1344418887-5262-1-git-send-email-peter.ujfalusi@ti.com> References: <1344418887-5262-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQnI3h2Dc87y5vc6LxgtKSfy/G3fUTi93XjbSXebo8toMlFBaEn2V0bvsvThFN1LBPh6Yumh Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Allocate the private data with devm_kzalloc. Signed-off-by: Peter Ujfalusi --- sound/soc/codecs/twl4030.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 1247c4a..6a00c01 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -2235,7 +2235,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; @@ -2257,7 +2258,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);