From patchwork Thu May 23 15:25:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17137 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-fa0-f70.google.com (mail-fa0-f70.google.com [209.85.161.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 675702395B for ; Thu, 23 May 2013 15:26:31 +0000 (UTC) Received: by mail-fa0-f70.google.com with SMTP id w1sf2526449fad.1 for ; Thu, 23 May 2013 08:25:35 -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=WhbB+181IWJZw9fXL0AFt91bHMoonVkpsvvdXx6W4QM=; b=nCccE4cuZys4/QYwTmzGfR7UUL9uVh8X8iyaQW0corohJRCs2UQHIjgh17A65AO0EI GOVu8W0zX1VzW//mPGmPFnGac6sIT38vBpQISRe9b9AZUof00dgmAHABYKkx85hZdw8A 1PjpRHioSsDod1UDzXXbMnXIwZguBmoqKIQB2ky9A7pIdvm+RwnhaJhwaDxm9OlRMXBB kLzwQaqgj2hIxfOC9JSu+YjSygMa0Zx85kHBDZ/3eekYIbX9EgRLG7abKvbym5QqdDvs L0v2mme02M/TtxAfh/XV1GR5MP+8p4cf8gnqPKKouDGYBPxwAAVVJct0GQk+LZXuU7xS /CRw== X-Received: by 10.180.85.5 with SMTP id d5mr3709699wiz.0.1369322735238; Thu, 23 May 2013 08:25:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.76.71 with SMTP id i7ls1773533wiw.47.canary; Thu, 23 May 2013 08:25:35 -0700 (PDT) X-Received: by 10.180.39.233 with SMTP id s9mr25737594wik.25.1369322734366; Thu, 23 May 2013 08:25:34 -0700 (PDT) Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236]) by mx.google.com with ESMTPS id ga13si14706316wic.99.2013.05.23.08.25.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:34 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::236 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::236; Received: by mail-ve0-f182.google.com with SMTP id da11so2533084veb.27 for ; Thu, 23 May 2013 08:25:33 -0700 (PDT) X-Received: by 10.52.163.207 with SMTP id yk15mr4737919vdb.42.1369322733282; Thu, 23 May 2013 08:25:33 -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 c10csp56996vcs; Thu, 23 May 2013 08:25:32 -0700 (PDT) X-Received: by 10.180.107.35 with SMTP id gz3mr26010258wib.0.1369322732110; Thu, 23 May 2013 08:25:32 -0700 (PDT) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [2a00:1450:400c:c05::232]) by mx.google.com with ESMTPS id r9si14703948wia.118.2013.05.23.08.25.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:31 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::232 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::232; Received: by mail-wi0-f178.google.com with SMTP id hj6so923470wib.11 for ; Thu, 23 May 2013 08:25:31 -0700 (PDT) X-Received: by 10.180.72.195 with SMTP id f3mr43922383wiv.32.1369322731337; Thu, 23 May 2013 08:25:31 -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.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:30 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 02/16] mfd: 88pm860x: Convert to managed resources for allocating memory Date: Thu, 23 May 2013 16:25:03 +0100 Message-Id: <1369322717-30429-2-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: ALoCoQlhhKWQM8qzUoHidKB/DDWnC5Pyte+fF77ONavZQeiwz+e+V5gBBcTT6KAKThY61tBfrD25 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::236 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: , --- drivers/mfd/88pm860x-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 31ca555..ef6d82c 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c @@ -1150,7 +1150,8 @@ static int pm860x_probe(struct i2c_client *client, return -EINVAL; } - chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); + chip = devm_kzalloc(&client->dev, + sizeof(struct pm860x_chip), GFP_KERNEL); if (chip == NULL) return -ENOMEM; @@ -1160,7 +1161,6 @@ static int pm860x_probe(struct i2c_client *client, ret = PTR_ERR(chip->regmap); dev_err(&client->dev, "Failed to allocate register map: %d\n", ret); - kfree(chip); return ret; } chip->client = client; @@ -1204,7 +1204,6 @@ static int pm860x_remove(struct i2c_client *client) i2c_unregister_device(chip->companion); } regmap_exit(chip->regmap); - kfree(chip); return 0; }