From patchwork Sun Mar 16 15:06:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3839361 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2C58BF540 for ; Sun, 16 Mar 2014 15:06:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EC792021B for ; Sun, 16 Mar 2014 15:06:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BE4AC201FE for ; Sun, 16 Mar 2014 15:06:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E19532610C7; Sun, 16 Mar 2014 16:06:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5BC6D2610AC; Sun, 16 Mar 2014 16:06:39 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 04D152610AE; Sun, 16 Mar 2014 16:06:37 +0100 (CET) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by alsa0.perex.cz (Postfix) with ESMTP id C253F2610A6 for ; Sun, 16 Mar 2014 16:06:30 +0100 (CET) Received: by mail-pb0-f48.google.com with SMTP id md12so4626520pbc.7 for ; Sun, 16 Mar 2014 08:06:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=41jgsApFz8++2WazekEG6LRNtnrBUzZ1NFEY0n4JjDg=; b=kkaa/4oCq0UGxtvQ6Yui8tQbNVqDls4LZ4zD6rXzPyvjTiJN79K+RDRzCCDz5QjGXE sYRtl+1VMUNzneteGcOicUZVYYl7cutZoafZ5P5ZXnMh+pIVQVUJp+SyLhg0P0mqWk26 HFYDtOokZ1loxt4ldhHtuTrnndMgCi2segS+23w8sWzEdM5drzhhhzix3Tfcv+b3Byc7 qALrkOpf6jmFiP61FmHP61lj3q44Grybd+swwq1eeArGcJJrt+Mit3cDz8YsfJmeAKe+ TZDKcOJDc1trdfzjPCfOMbai7/2jUAftSTLZQ8Cuu/hOEJQuXmvIbIx++xWn65t8xFBA sFZg== X-Gm-Message-State: ALoCoQnhSLYdRvsfbvwBysOggOr3rSWJ/bw4/dJ8p1llirWN5YKCI7jXIAESndK0WMXMYcGTOvx6 X-Received: by 10.66.4.130 with SMTP id k2mr19927368pak.97.1394982389775; Sun, 16 Mar 2014 08:06:29 -0700 (PDT) Received: from [192.168.0.102] (218-164-130-226.dynamic.hinet.net. [218.164.130.226]) by mx.google.com with ESMTPSA id st4sm57660078pab.34.2014.03.16.08.06.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Mar 2014 08:06:29 -0700 (PDT) Message-ID: <1394982385.19788.4.camel@phoenix> From: Axel Lin To: Mark Brown Date: Sun, 16 Mar 2014 23:06:25 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Cc: alsa-devel@alsa-project.org, Liam Girdwood , Jyri Sarha Subject: [alsa-devel] [PATCH v2] ASoC: tlv320aic31xx: Don't call kfree for memory allocated by devm_kzalloc X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The kfree call is not necessary, but we need to call snd_soc_unregister_codec() in remove(). Signed-off-by: Axel Lin Acked-by: Jyri Sarha --- sound/soc/codecs/tlv320aic31xx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index d3517a9..d5d6213 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -1228,7 +1228,6 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, return -ENOMEM; aic31xx->regmap = devm_regmap_init_i2c(i2c, regmap_config); - if (IS_ERR(aic31xx->regmap)) { ret = PTR_ERR(aic31xx->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", @@ -1241,18 +1240,14 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, aic31xx_device_init(aic31xx); - ret = snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, + return snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, aic31xx_dai_driver, ARRAY_SIZE(aic31xx_dai_driver)); - - return ret; } static int aic31xx_i2c_remove(struct i2c_client *i2c) { - struct aic31xx_priv *aic31xx = dev_get_drvdata(&i2c->dev); - - kfree(aic31xx); + snd_soc_unregister_codec(&i2c->dev); return 0; } @@ -1274,7 +1269,7 @@ static struct i2c_driver aic31xx_i2c_driver = { .of_match_table = of_match_ptr(tlv320aic31xx_of_match), }, .probe = aic31xx_i2c_probe, - .remove = (aic31xx_i2c_remove), + .remove = aic31xx_i2c_remove, .id_table = aic31xx_i2c_id, };