From patchwork Tue Aug 14 14:22: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: 1320571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C55893FC81 for ; Tue, 14 Aug 2012 14:37:56 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T1IAx-0003VB-A5; Tue, 14 Aug 2012 14:32:56 +0000 Received: from na3sys009aog128.obsmtp.com ([74.125.149.141]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T1I13-0004Pl-Hf for linux-arm-kernel@lists.infradead.org; Tue, 14 Aug 2012 14:22:46 +0000 Received: from mail-ob0-f175.google.com ([209.85.214.175]) (using TLSv1) by na3sys009aob128.postini.com ([74.125.148.12]) with SMTP ID DSNKUCpfL8cR9K+0cSIXS5Y+81nH/vckXvJd@postini.com; Tue, 14 Aug 2012 07:22:41 PDT Received: by obc16 with SMTP id 16so650697obc.20 for ; Tue, 14 Aug 2012 07:22:39 -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=Q79hKBo5POM5gBVtn1fEboXbK47UHtSI9uuRYW9NAuM=; b=nlEC7NRj4SaFny5Il65VDb6UzGXQbOp2MXzdqGtSfGVx3TeC9A3RO86CpkI/FqhTLY 4P49pvXLhJvbQ+5wueRgeiBglZE/bzTH+BJsdgFoTPq5KGpRNtuC3VKZqKeSRhAR624Y yYH5xqZkee6uftAg52aDnxC1op93I4k5HK3Lck9vp20qAFYrlIGLSdVB16f3DDfUZIDc NGHgdBk+7XhVUrz28U4uMD363t+497nzzI78QBo6NrxsfhteMfRRCUx8w+KSq98JuQa7 Y8TuLTKSGc3yh+bRYg7L6oJ/+7hZbZCZt9t/zPY8Ti/SFAH17DMPLupHE6BzWMnaTwBx 42Pw== Received: by 10.182.51.65 with SMTP id i1mr19316307obo.45.1344954159206; Tue, 14 Aug 2012 07:22:39 -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.22.35 (version=SSLv3 cipher=OTHER); Tue, 14 Aug 2012 07:22:38 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Grant Likely , Rob Herring Subject: [PATCH v2 02/14] MFD: twl4030-audio: Convert to use devm_kzalloc Date: Tue, 14 Aug 2012 17:22:30 +0300 Message-Id: <1344954162-7985-3-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: ALoCoQmDSPpVWtT4rR6csTkl1WUKo5VCr3bXDYYZlyjTI+ARo6uwTXmUAG/N2/AvRaXm+eVBk+9C X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.141 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: alsa-devel@alsa-project.org, Benoit Cousson , devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, Tero Kristo , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Peter Ujfalusi --- drivers/mfd/twl4030-audio.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c index ac04b4f..efa2d42 100644 --- a/drivers/mfd/twl4030-audio.c +++ b/drivers/mfd/twl4030-audio.c @@ -188,7 +188,8 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev) twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, val, TWL4030_REG_APLL_CTL); - audio = kzalloc(sizeof(struct twl4030_audio), GFP_KERNEL); + audio = devm_kzalloc(&pdev->dev, sizeof(struct twl4030_audio), + GFP_KERNEL); if (!audio) return -ENOMEM; @@ -229,22 +230,18 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev) ret = -ENODEV; } - if (!ret) - return 0; + if (ret) { + platform_set_drvdata(pdev, NULL); + twl4030_audio_dev = NULL; + } - platform_set_drvdata(pdev, NULL); - kfree(audio); - twl4030_audio_dev = NULL; return ret; } static int __devexit twl4030_audio_remove(struct platform_device *pdev) { - struct twl4030_audio *audio = platform_get_drvdata(pdev); - mfd_remove_devices(&pdev->dev); platform_set_drvdata(pdev, NULL); - kfree(audio); twl4030_audio_dev = NULL; return 0;