From patchwork Thu May 23 15:25:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 17142 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 63F7A2395B for ; Thu, 23 May 2013 15:26:37 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf3825874ghb.10 for ; Thu, 23 May 2013 08:25:42 -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=nnuJtppz2RGygsEX/0VImnQZMxh7g9/EaO8miyK20ds=; b=I1K8ChXwD6E6/iLuohFn+iVhP/SW6Y/q3vIenp0PenB/j81CkjtPoL557OqDG4O0Eg to9NZFBvZPvgjw0X7yxKFDNRFYra8IcIbzxejrZskBJXMIBsuyx5DCEzlqYGeIA6iTi4 sEZS4/eJTL1VP+jmwtipCC6KDC/48XMmEh5IJuIRGfbO656X3r9PK6Vk2f9Fdne65zj3 XTxUycHF+Y4sttoB6oARtIBU8X3rOmaMIRhsOURyhkAvdQxjhXX8N2k/PkNPSCLdJtVS Y9bJ/VDREC7yRFsX0gnxovWQLw4BqG/A9v8oXJ8ARxBzHyYiK80Eq2p2qQxezMUjBB4i bY2Q== X-Received: by 10.236.192.131 with SMTP id i3mr6040281yhn.29.1369322742012; Thu, 23 May 2013 08:25:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.9 with SMTP id m9ls1363607qej.55.gmail; Thu, 23 May 2013 08:25:41 -0700 (PDT) X-Received: by 10.52.0.102 with SMTP id 6mr5026071vdd.9.1369322741736; Thu, 23 May 2013 08:25:41 -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 b5si6632988vcl.45.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: 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 da11so2533236veb.27 for ; Thu, 23 May 2013 08:25:41 -0700 (PDT) X-Received: by 10.52.34.114 with SMTP id y18mr4772474vdi.56.1369322741594; Thu, 23 May 2013 08:25:41 -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 c10csp57008vcs; Thu, 23 May 2013 08:25:41 -0700 (PDT) X-Received: by 10.205.68.195 with SMTP id xz3mr7149127bkb.41.1369322740378; Thu, 23 May 2013 08:25:40 -0700 (PDT) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [2a00:1450:400c:c05::22e]) by mx.google.com with ESMTPS id fy10si14712401wic.48.2013.05.23.08.25.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:40 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22e is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22e; Received: by mail-wi0-f174.google.com with SMTP id c10so4641627wiw.7 for ; Thu, 23 May 2013 08:25:39 -0700 (PDT) X-Received: by 10.180.108.3 with SMTP id hg3mr25792512wib.17.1369322739853; Thu, 23 May 2013 08:25:39 -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.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 08:25:38 -0700 (PDT) From: Lee Jones To: linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: Lee Jones Subject: [PATCH 07/16] mfd: adp5520: Convert to managed resources for allocating memory Date: Thu, 23 May 2013 16:25:08 +0100 Message-Id: <1369322717-30429-7-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: ALoCoQmjmNBkAjOhyVYUVcSonKuXtyIaFhQyBc3fgNgbPPndXlJtk7PFbEs68Z2Lw+Sdsu+AQeOF 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: , Signed-off-by: Lee Jones --- drivers/mfd/adp5520.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c index 0d2eba0..28346ad 100644 --- a/drivers/mfd/adp5520.c +++ b/drivers/mfd/adp5520.c @@ -223,7 +223,7 @@ static int adp5520_probe(struct i2c_client *client, return -ENODEV; } - chip = kzalloc(sizeof(*chip), GFP_KERNEL); + chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); if (!chip) return -ENOMEM; @@ -244,7 +244,7 @@ static int adp5520_probe(struct i2c_client *client, if (ret) { dev_err(&client->dev, "failed to request irq %d\n", chip->irq); - goto out_free_chip; + return ret; } } @@ -302,9 +302,6 @@ out_free_irq: if (chip->irq) free_irq(chip->irq, chip); -out_free_chip: - kfree(chip); - return ret; } @@ -317,7 +314,6 @@ static int adp5520_remove(struct i2c_client *client) adp5520_remove_subdevs(chip); adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0); - kfree(chip); return 0; }