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: 1413681 Return-Path: X-Original-To: patchwork-linux-omap@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 CFFE63FC85 for ; Thu, 6 Sep 2012 12:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754261Ab2IFMMq (ORCPT ); Thu, 6 Sep 2012 08:12:46 -0400 Received: from na3sys009aog126.obsmtp.com ([74.125.149.155]:46388 "EHLO na3sys009aog126.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754029Ab2IFMMo (ORCPT ); Thu, 6 Sep 2012 08:12:44 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUEiTPBm+R7VXogYFFS3beY/I6LTh526N@postini.com; Thu, 06 Sep 2012 05:12:44 PDT Received: by obbuo13 with SMTP id uo13so2297319obb.19 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=gPjYbk2XbQ/3Gd7sXxFuBscKgHn6uFSUahIF1+VmmGWdVBFMLPeli3A9C00HxZ1jpr YLrElScx8i5sUQ6vegIBX+prXkkQ4TqKTSKsParj1huUfU0cbxc8aObvWyjNRgO3sf7f QIOKDNOER/44Ow6YXglvKFt13CfuHt8gRd4XT+ipJXkoh/cbmtUOrZcJN78VjyB+87RD 96QJ739Q4tjEOfJsiOYXgGP1iDfGHLzgZQhsT3aITnQzxgBtG0VMJJ5udrlDt/viv8Er Ku6ZQuHZ1GG+fcwRbyjSBXFnSLoKB9UzzVcxfOM30PONqK93NeBGMC3M/NS0r7i5ogsv gwIw== 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 Cc: Tero Kristo , alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Benoit Cousson , linux-kernel@vger.kernel.org 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: ALoCoQmpY39nTM56kxwNSKhXedhBvVaxw5hERP9w/Ywuc2TIv5aKih874x4vD1abWyeB2Z4VfSs1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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);