From patchwork Mon Sep 10 10:46:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1431311 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 1285F40AB9 for ; Mon, 10 Sep 2012 10:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757342Ab2IJKqy (ORCPT ); Mon, 10 Sep 2012 06:46:54 -0400 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]:37343 "EHLO na3sys009aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757212Ab2IJKqu (ORCPT ); Mon, 10 Sep 2012 06:46:50 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKUE3FGVEsd5kTJzfo6rg3XxDi1UL22jJi@postini.com; Mon, 10 Sep 2012 03:46:50 PDT Received: by obbuo13 with SMTP id uo13so2659030obb.19 for ; Mon, 10 Sep 2012 03:46:48 -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=hNurdkZiFusO90Ri83Cx0sDcsVbyD8VMblFmtjJM9VJYeEOEwhVCbQL/aF2Bd99P1H 40TVTrU9XVH5WqmP19k4aJ7RDP63HQLS80R3EFbeOKfSEGEzhffakTYEUQsBEPuVOJsm wogzw48qAlI5ux3EE5u2El+YYayqtNJwROsycsfoRVjmT6InO2DrJfFLmGE3ca80brNs CsNGe3H+B0jZgutSntySPy9RgatpXXoz3QYekz2nGmFMwbp21TmHMfVRK016IeejOayE maKDouM/KOeYqSZWYJ29SMlnvr6LgmcToYHsDUd+Fr4WLbCJzWGLGkeyUKWflhoCYr/u RG6Q== Received: by 10.60.29.228 with SMTP id n4mr13897385oeh.27.1347274008646; Mon, 10 Sep 2012 03:46:48 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id 5sm8888098oeq.4.2012.09.10.03.46.45 (version=SSLv3 cipher=OTHER); Mon, 10 Sep 2012 03:46:48 -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 v4 12/14] ASoC: twl4030: Convert to use devm_kzalloc Date: Mon, 10 Sep 2012 13:46:30 +0300 Message-Id: <1347273992-9107-13-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347273992-9107-1-git-send-email-peter.ujfalusi@ti.com> References: <1347273992-9107-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQmhqgpaS3Hsn6sBuXSf3O0rrWWbKcwZHqVc33eYX8ZfLuEh5rSo5fJaxV7nM2tqBs3/yJu9 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);