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: 1293801 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BCCFDDFFEB for ; Wed, 8 Aug 2012 09:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030313Ab2HHJmP (ORCPT ); Wed, 8 Aug 2012 05:42:15 -0400 Received: from na3sys009aog130.obsmtp.com ([74.125.149.143]:58057 "EHLO na3sys009aog130.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030310Ab2HHJmO (ORCPT ); Wed, 8 Aug 2012 05:42:14 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob130.postini.com ([74.125.148.12]) with SMTP ID DSNKUCI0ctwV5zJt+F5MyDTl6fSzUwypiiDy@postini.com; Wed, 08 Aug 2012 02:42:13 PDT Received: by obbuo13 with SMTP id uo13so1017554obb.33 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=AtrBm7EIvXCbfnDl5wge3ba/qeqPXVjQfCQVyEpEmhYpKC6XiAplb9Qde1P/caVFnt Fm2uOzkqKRDSnSypZNocgy3Fm5V5ShFGHU7VFSjxt6fcMupRrY2n2odL/tN3IkxDPC7s jV46zhowV+GUrXIrXit98w0s6eHAIBS3PH3ETvKHC0w+Q4ioihieq3viKLP4/K8pDwbb wBipA0vsqgLC69xTKpnJtUIlKsORYDpLuqQUfJR6M0Dt1M3JQhqVXfKTqZQYDn9p5ka8 eqiDjnJZgSXXwdUVQe7QmlGmTkHTYDVtCTmgxsVlZVHAzQjrqQrqd1lATBFKB0rkK53X vKNA== 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: ALoCoQmL+CFtjl1EaCvwJvBynLJr58/lr7grzT9V4WbEVFRAHbuAoaud1bOM8ODZBJ3Ta2P2zgnR 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 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);