From patchwork Tue Aug 14 14:22:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1320691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C53FB3FC81 for ; Tue, 14 Aug 2012 14:42:58 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T1IFc-0007HF-2x; Tue, 14 Aug 2012 14:37:45 +0000 Received: from na3sys009aob106.obsmtp.com ([74.125.149.76] helo=na3sys009aog106.obsmtp.com) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T1I1d-0004ki-3c for linux-arm-kernel@lists.infradead.org; Tue, 14 Aug 2012 14:23:19 +0000 Received: from mail-ob0-f171.google.com ([209.85.214.171]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKUCpfU0hiGmA0gMih7WwFrFfPiRoOAbBm@postini.com; Tue, 14 Aug 2012 07:23:17 PDT Received: by obqv19 with SMTP id v19so573575obq.2 for ; Tue, 14 Aug 2012 07:23:14 -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=es2Hv9XBMC4Q11Rebw8+Kv5beo/nkT0B4zq/FFZsc6U=; b=BVPg6jMUgvyQCnmrZLOVnvRtppzk/IU2Ly8e/FNR2U5i6ZGdbRSQfhRskmGurSxssW tiF2f4lij1Nw6/HyNKhF+IBVGRsbbyDMCh22tNuEEVwiq5WLDTKmiObBHrn9h0FBoMMV jnm04fum1miGbFAENCcumXi066g9XNFl8Y80a5qgQKndwtZbmY2WHWCTSx+8xdvW5v1h P8r0uoXpfVacYKsapcMeXr2RIJen/DUWTRiqfuKDSncLGx/TKa1wvuHqT+5Vjo8a1ySg cXOZLH4wVlrx60SNe2ZyV8dN5uos4bd5v4fgzwOGmIIA0FKpPlaDbqyoBQ1IcIFyGLyl hLcw== Received: by 10.182.207.6 with SMTP id ls6mr19090432obc.36.1344954194715; Tue, 14 Aug 2012 07:23:14 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id kc5sm2799741obb.21.2012.08.14.07.23.11 (version=SSLv3 cipher=OTHER); Tue, 14 Aug 2012 07:23:14 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Grant Likely , Rob Herring Subject: [PATCH v2 12/14] ASoC: twl4030: Convert to use devm_kzalloc Date: Tue, 14 Aug 2012 17:22:40 +0300 Message-Id: <1344954162-7985-13-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1344954162-7985-1-git-send-email-peter.ujfalusi@ti.com> References: <1344954162-7985-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQmr4Ep88EaJCUtd9nHesC6lFsKiVjsbghK8AwkK0aiBC0dlPDUq/iw6XSfFqeSFo33OE1yH 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.76 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 files 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);