From patchwork Thu May 23 15:25:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17140 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BA722395B for ; Thu, 23 May 2013 15:26:35 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bv4sf4133045qab.2 for ; Thu, 23 May 2013 08:25:39 -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=NC7UZLS0e6yGDAJxlUnu03m2PB+CfU3YfMOaoRu7g2k=; b=h3vjDmkuaA1veiBS4F1ggVYI00JPrDVp+Q1o+3rfuwcz/i3fZkTKRrGycP2Y07TISS BddoKK44Ar+QRnlol8jV88I/oNxDfAs4jbzgRtqtLPeYJafslYRgFwUlp65O9hDN2cT9 qCZjPmXKRWR/BtlyqRttVcHgEwvvGl7MPCRryvFTUXzCu3oRiQJfohzqpFqG9GNQBtkE agGMQQMLFrh/Tmmdqo4Esy6ZI3lhnUCm1Zv9dftFHeGSen5CuHMdCvGU8VMjhuOVHaN/ t+uhTgzLk90eXa0fQcGwrzz/Ha2BwRWGo/DyylKsuPneO9SElNY/LIctk5T4PJJg+BOD SEtw== X-Received: by 10.236.128.207 with SMTP id f55mr6685097yhi.28.1369322739927; Thu, 23 May 2013 08:25:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.18.195 with SMTP id y3ls1524135qed.67.gmail; Thu, 23 May 2013 08:25:39 -0700 (PDT) X-Received: by 10.58.171.167 with SMTP id av7mr5562330vec.15.1369322739734; Thu, 23 May 2013 08:25:39 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id tn5si6648895vdc.26.2013.05.23.08.25.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf11so2257484vcb.26 for ; Thu, 23 May 2013 08:25:39 -0700 (PDT) X-Received: by 10.220.112.16 with SMTP id u16mr5679784vcp.40.1369322739603; Thu, 23 May 2013 08:25:39 -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 c10csp57004vcs; Thu, 23 May 2013 08:25:39 -0700 (PDT) X-Received: by 10.180.89.140 with SMTP id bo12mr44882477wib.22.1369322738406; Thu, 23 May 2013 08:25:38 -0700 (PDT) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [2a00:1450:400c:c00::22f]) by mx.google.com with ESMTPS id o7si14704808wiv.115.2013.05.23.08.25.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:38 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22f is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c00::22f; Received: by mail-wg0-f47.google.com with SMTP id e11so2242836wgh.14 for ; Thu, 23 May 2013 08:25:38 -0700 (PDT) X-Received: by 10.180.72.195 with SMTP id f3mr43923290wiv.32.1369322738026; Thu, 23 May 2013 08:25:38 -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.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:37 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 06/16] mfd: abx500-core: Convert to managed resources for allocating memory Date: Thu, 23 May 2013 16:25:07 +0100 Message-Id: <1369322717-30429-6-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: ALoCoQkAUprWK+a9MUd2zXd7plZmn/I1cmNX0U0bD2b2/XKjk6K1XQanv69aAIKCvIg3AqZ5S447 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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/abx500-core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c index 3714acb..f3a15aa 100644 --- a/drivers/mfd/abx500-core.c +++ b/drivers/mfd/abx500-core.c @@ -36,7 +36,9 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops) { struct abx500_device_entry *dev_entry; - dev_entry = kzalloc(sizeof(struct abx500_device_entry), GFP_KERNEL); + dev_entry = devm_kzalloc(dev, + sizeof(struct abx500_device_entry), + GFP_KERNEL); if (!dev_entry) { dev_err(dev, "register_ops kzalloc failed"); return -ENOMEM; @@ -54,12 +56,8 @@ void abx500_remove_ops(struct device *dev) struct abx500_device_entry *dev_entry, *tmp; list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list) - { - if (dev_entry->dev == dev) { + if (dev_entry->dev == dev) list_del(&dev_entry->list); - kfree(dev_entry); - } - } } EXPORT_SYMBOL(abx500_remove_ops);