From patchwork Thu May 23 15:25:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17145 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ea0-f198.google.com (mail-ea0-f198.google.com [209.85.215.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 370D423976 for ; Thu, 23 May 2013 15:26:44 +0000 (UTC) Received: by mail-ea0-f198.google.com with SMTP id d10sf2481696eaj.1 for ; Thu, 23 May 2013 08:25:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=mGHda/SUrgKJwJ0OthwwXRK/uccgzxUJzY85iKWEZsc=; b=NYPOKvA1/ek2yeZfkLLHcef4tcmkaMAfGwqGlevsF3R6jDCRRKltlGvBsYqwc2O+wg 8Yt0JXshnSZUV9qm3aJaYl0JP0Z/zrkaE4Tncn5fC7FpYsHHrGjUgANmhGFS3c17XSSE Bpfvr5DpQ/IkcxH488WJViOLTfBqDsAeaFjc+2KjYyQgnEFHpueVbnz3/hiA9zY7B/Qd Sp3nQf9gZE/KCMedLncdUjCWBXxX9mA2Hu/r0uRHld5288Xb4zwG2p5wKPgpxJYocBSQ W5KJ168tyVuyVDM8czn6c9HhmLB3K7FpAeTKd8Rr6XizUHAQFjxM8Y9SjL3KEa2Lp+OZ NRqQ== X-Received: by 10.180.76.174 with SMTP id l14mr6192175wiw.5.1369322748024; Thu, 23 May 2013 08:25:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.78.72 with SMTP id z8ls1881575wiw.38.canary; Thu, 23 May 2013 08:25:47 -0700 (PDT) X-Received: by 10.180.183.139 with SMTP id em11mr44853362wic.16.1369322747952; Thu, 23 May 2013 08:25:47 -0700 (PDT) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [2607:f8b0:400c:c01::22e]) by mx.google.com with ESMTPS id p15si9221855wiw.80.2013.05.23.08.25.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:47 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22e; Received: by mail-ve0-f174.google.com with SMTP id oy12so2523255veb.33 for ; Thu, 23 May 2013 08:25:46 -0700 (PDT) X-Received: by 10.52.163.207 with SMTP id yk15mr4738565vdb.42.1369322746780; Thu, 23 May 2013 08:25:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp57016vcs; Thu, 23 May 2013 08:25:45 -0700 (PDT) X-Received: by 10.180.109.84 with SMTP id hq20mr25668834wib.11.1369322745360; Thu, 23 May 2013 08:25:45 -0700 (PDT) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [2a00:1450:400c:c03::22b]) by mx.google.com with ESMTPS id t10si14728631wiw.2.2013.05.23.08.25.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:45 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22b is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::22b; Received: by mail-we0-f171.google.com with SMTP id t59so2227270wes.30 for ; Thu, 23 May 2013 08:25:45 -0700 (PDT) X-Received: by 10.180.185.244 with SMTP id ff20mr44902935wic.0.1369322744976; Thu, 23 May 2013 08:25:44 -0700 (PDT) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPSA id d10sm36397561wik.0.2013.05.23.08.25.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:44 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 10/16] mfd: davinci_voicecodec: Convert to managed resources for allocating memory Date: Thu, 23 May 2013 16:25:11 +0100 Message-Id: <1369322717-30429-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369322717-30429-1-git-send-email-lee.jones@linaro.org> References: <1369322717-30429-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmu4J/eK0Nv/CQxUbyR41korfsSQNKzKmmxcTY0Mi6y9u9JNk35VYjsq0RQ8JjaSK4vwCGy X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Lee Jones --- drivers/mfd/davinci_voicecodec.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c index c60ab0c..b6e2973 100644 --- a/drivers/mfd/davinci_voicecodec.c +++ b/drivers/mfd/davinci_voicecodec.c @@ -50,7 +50,8 @@ static int __init davinci_vc_probe(struct platform_device *pdev) struct mfd_cell *cell = NULL; int ret; - davinci_vc = kzalloc(sizeof(struct davinci_vc), GFP_KERNEL); + davinci_vc = devm_kzalloc(&pdev->dev, + sizeof(struct davinci_vc), GFP_KERNEL); if (!davinci_vc) { dev_dbg(&pdev->dev, "could not allocate memory for private data\n"); @@ -61,8 +62,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev) if (IS_ERR(davinci_vc->clk)) { dev_dbg(&pdev->dev, "could not get the clock for voice codec\n"); - ret = -ENODEV; - goto fail1; + return -ENODEV; } clk_enable(davinci_vc->clk); @@ -145,8 +145,6 @@ fail2: clk_disable(davinci_vc->clk); clk_put(davinci_vc->clk); davinci_vc->clk = NULL; -fail1: - kfree(davinci_vc); return ret; } @@ -164,8 +162,6 @@ static int davinci_vc_remove(struct platform_device *pdev) clk_put(davinci_vc->clk); davinci_vc->clk = NULL; - kfree(davinci_vc); - return 0; }