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: 1320261 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 5D88ADF215 for ; Tue, 14 Aug 2012 14:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753646Ab2HNO0P (ORCPT ); Tue, 14 Aug 2012 10:26:15 -0400 Received: from na3sys009aog137.obsmtp.com ([74.125.149.18]:55002 "EHLO na3sys009aog137.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756323Ab2HNOXQ (ORCPT ); Tue, 14 Aug 2012 10:23:16 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]) (using TLSv1) by na3sys009aob137.postini.com ([74.125.148.12]) with SMTP ID DSNKUCpfU0hiGmA0gMih7WwFrFfPiRoOAbBm@postini.com; Tue, 14 Aug 2012 07:23:16 PDT Received: by obhx4 with SMTP id x4so617283obh.28 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=bBdYipwIzhS7HSXs5seqDrfUAILTOkZZ6npITEtt4KndSGGuz/9zKJfPx5455lpA0R apPn/jl6eM01oD20CBrb2OGYOD8433PCSNnoEf3Z/vM5870hkBfosWxxZmZbuvVGzr1q BlldnBVeomXoi8SphQ853BrMlcniF1Zx4wyMnET3RjplubDJ/+PJaSP5eMS2CAByUHR4 grO4q8qNzhS7og9tHLZ8u6isnAwhPt7v/wLpWrk7dNm99yhZOemHRCMSkyrqYHAlya04 SCc5PBf+NT0woKZVV1HUY9fKRPFhZm29sphHtTsF/mIctjjnBfFEoDc1mb0KBbfOE8XO DQGw== 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 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 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: ALoCoQmauu7K44QprJZiFItWBE0XjyR5SFN2+gao0XUm+rCUp+pwsf47lYqlfxJIkheZ3WnF8MAH 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 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);