From patchwork Thu May 23 15:25:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17143 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0DF202395B for ; Thu, 23 May 2013 15:26:39 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id j11sf4130350qag.8 for ; Thu, 23 May 2013 08:25:43 -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=ZF9x4n1Bu2rbhSDp4Paw7yCfGYLUC8sq1/V0nn8kHcw=; b=ENCUGs3tS+kYuVJOV8BPeZggj879pc/JcJRWTHDW/E0c5AF2uYciULcAZdRveNhB7M BelKJLLQCMcOUrfMzEWpc0UdulEPlBVl3/maFD0aZCKNWAQpYFhT2ZRXS5L+rpBdllcE WubqoXEbbn0YMe510vDlhBaesA4huj/QtaH5snmUTDLt3oIPf26UhfhEonaiQ0IaRK61 mij+49LAl9/epvAS7u1Odwy6RbM7/vp3gYPjjBqWl+Fb6dojOrwlhz12ifKHNzC/Jf7l oxbSUf8Ie/RJ10pW9oD+zKQ04rdw0xS98G5CTvcNYmlNm5GL88NKIG9wVEOswstamAbZ d2Vg== X-Received: by 10.224.200.202 with SMTP id ex10mr6561038qab.8.1369322743545; Thu, 23 May 2013 08:25:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.106.73 with SMTP id gs9ls1408720qeb.27.gmail; Thu, 23 May 2013 08:25:43 -0700 (PDT) X-Received: by 10.58.215.200 with SMTP id ok8mr5647424vec.21.1369322743309; Thu, 23 May 2013 08:25:43 -0700 (PDT) Received: from mail-vb0-x22b.google.com (mail-vb0-x22b.google.com [2607:f8b0:400c:c02::22b]) by mx.google.com with ESMTPS id un20si6649812veb.2.2013.05.23.08.25.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:43 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22b 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:c02::22b; Received: by mail-vb0-f43.google.com with SMTP id e12so14588vbg.2 for ; Thu, 23 May 2013 08:25:43 -0700 (PDT) X-Received: by 10.220.192.3 with SMTP id do3mr5647557vcb.16.1369322742933; Thu, 23 May 2013 08:25:42 -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 c10csp57010vcs; Thu, 23 May 2013 08:25:42 -0700 (PDT) X-Received: by 10.181.13.112 with SMTP id ex16mr44854442wid.28.1369322741973; Thu, 23 May 2013 08:25:41 -0700 (PDT) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [2a00:1450:400c:c00::234]) by mx.google.com with ESMTPS id ln17si14716420wic.15.2013.05.23.08.25.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:41 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::234 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::234; Received: by mail-wg0-f52.google.com with SMTP id z11so2107474wgg.31 for ; Thu, 23 May 2013 08:25:41 -0700 (PDT) X-Received: by 10.180.210.207 with SMTP id mw15mr25808817wic.10.1369322741467; Thu, 23 May 2013 08:25:41 -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.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:40 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 08/16] mfd: asic3: Convert to managed resources for allocating memory Date: Thu, 23 May 2013 16:25:09 +0100 Message-Id: <1369322717-30429-8-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: ALoCoQn+oFwi2I1U21GnzRKXrYNE+PBp5qKCX1CVo8SGwrKtxHCLw9FS2DbuafCBsvL5Mlo9NjPm X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22b 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/asic3.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 1b15986..9532f74 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c @@ -958,7 +958,8 @@ static int __init asic3_probe(struct platform_device *pdev) unsigned long clksel; int ret = 0; - asic = kzalloc(sizeof(struct asic3), GFP_KERNEL); + asic = devm_kzalloc(&pdev->dev, + sizeof(struct asic3), GFP_KERNEL); if (asic == NULL) { printk(KERN_ERR "kzalloc failed\n"); return -ENOMEM; @@ -970,16 +971,14 @@ static int __init asic3_probe(struct platform_device *pdev) mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) { - ret = -ENOMEM; dev_err(asic->dev, "no MEM resource\n"); - goto out_free; + return -ENOMEM; } asic->mapping = ioremap(mem->start, resource_size(mem)); if (!asic->mapping) { - ret = -ENOMEM; dev_err(asic->dev, "Couldn't ioremap\n"); - goto out_free; + return -ENOMEM; } asic->irq_base = pdata->irq_base; @@ -1033,9 +1032,6 @@ static int __init asic3_probe(struct platform_device *pdev) out_unmap: iounmap(asic->mapping); - out_free: - kfree(asic); - return ret; } @@ -1058,8 +1054,6 @@ static int asic3_remove(struct platform_device *pdev) iounmap(asic->mapping); - kfree(asic); - return 0; }