From patchwork Thu May 23 15:25:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17144 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CAA9F2395B for ; Thu, 23 May 2013 15:26:43 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id m1sf4654040ves.7 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=hgbczM7oUoAJFSVTmg7iG7KF0RXSaYpAewwCVbpgsXM=; b=AbzAFY4wvYMBTEk7zc/zqwRIt5Yf4UsIDeODoN945C9/KDjrha4sSx3oiL/eJZo7vk dcqsr6M/k2HcD7iMnYMRrgoMSTEDVfwcj4HKGh67fH3usi6ZFaICQjd4rbeEgPwYyTOC 8BZvMnkN6hIgXXfqFIbrlPMZdcqjhku8RQGEfXBF7nbE/WOg+7KQ2RZISEHS3zVdoV9U OLI+eOi/Mi8qQ5yHIxtm/1yeGTNB1fxi6arCUkCWQTqeTJ7g0n4fF+IaLKTSvzgy0DRd PDkYLy/vKGgXKkQ0bRhCIo9WRSQL2ECb2zW1gTDplq4Pbr3BYKHalvq6npHFRc+H3FwI cKZA== X-Received: by 10.236.68.164 with SMTP id l24mr6532915yhd.19.1369322748476; Thu, 23 May 2013 08:25:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.137 with SMTP id lk9ls1506437qeb.68.gmail; Thu, 23 May 2013 08:25:48 -0700 (PDT) X-Received: by 10.58.225.228 with SMTP id rn4mr5611220vec.35.1369322748239; Thu, 23 May 2013 08:25:48 -0700 (PDT) Received: from mail-vb0-x22f.google.com (mail-vb0-x22f.google.com [2607:f8b0:400c:c02::22f]) by mx.google.com with ESMTPS id q13si6637664vcw.36.2013.05.23.08.25.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:48 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22f 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::22f; Received: by mail-vb0-f47.google.com with SMTP id x13so2248314vbb.20 for ; Thu, 23 May 2013 08:25:48 -0700 (PDT) X-Received: by 10.58.172.67 with SMTP id ba3mr5514993vec.58.1369322748061; Thu, 23 May 2013 08:25:48 -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 c10csp57017vcs; Thu, 23 May 2013 08:25:47 -0700 (PDT) X-Received: by 10.180.36.205 with SMTP id s13mr44384658wij.31.1369322747152; Thu, 23 May 2013 08:25:47 -0700 (PDT) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [2a00:1450:400c:c05::22a]) by mx.google.com with ESMTPS id s10si14708171wik.90.2013.05.23.08.25.46 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: 2a00:1450:400c:c05::22a is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22a; Received: by mail-wi0-f170.google.com with SMTP id hr14so5086041wib.5 for ; Thu, 23 May 2013 08:25:46 -0700 (PDT) X-Received: by 10.180.36.147 with SMTP id q19mr25431767wij.26.1369322746596; Thu, 23 May 2013 08:25:46 -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.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:45 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 11/16] mfd: htc-egpio: Convert to managed resources for allocating memory Date: Thu, 23 May 2013 16:25:12 +0100 Message-Id: <1369322717-30429-11-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: ALoCoQmAb9QORyeTI3vrWxMLz8mBSz3XVDV7ARsu2i8AZ6yddHi15MKjlu7NCHkX0Zlh3NZIVuqR X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22f 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/htc-egpio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c index bbaec0c..f2e0ad4 100644 --- a/drivers/mfd/htc-egpio.c +++ b/drivers/mfd/htc-egpio.c @@ -270,7 +270,7 @@ static int __init egpio_probe(struct platform_device *pdev) int ret; /* Initialize ei data structure. */ - ei = kzalloc(sizeof(*ei), GFP_KERNEL); + ei = devm_kzalloc(&pdev->dev, sizeof(*ei), GFP_KERNEL); if (!ei) return -ENOMEM; @@ -306,7 +306,9 @@ static int __init egpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ei); ei->nchips = pdata->num_chips; - ei->chip = kzalloc(sizeof(struct egpio_chip) * ei->nchips, GFP_KERNEL); + ei->chip = devm_kzalloc(&pdev->dev, + sizeof(struct egpio_chip) * ei->nchips, + GFP_KERNEL); if (!ei->chip) { ret = -ENOMEM; goto fail; @@ -361,7 +363,6 @@ static int __init egpio_probe(struct platform_device *pdev) fail: printk(KERN_ERR "EGPIO failed to setup\n"); - kfree(ei); return ret; } @@ -380,8 +381,6 @@ static int __exit egpio_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 0); } iounmap(ei->base_addr); - kfree(ei->chip); - kfree(ei); return 0; }