From patchwork Thu Feb 20 08:53:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24991 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DDB922066E for ; Thu, 20 Feb 2014 09:02:00 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id jx11sf3331662veb.4 for ; Thu, 20 Feb 2014 01:02:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=OjQ/r1lCiCOZpHGSJB/RrvSguHyy0Ligu2SEOdcl13Q=; b=MSsSy9fhWgXtlWWITxdyaYLNkl5WXTI7v0+4Enozo4r1FkOXuC6vRAw3ILxEBnD8YM QO6+2LUB3jzHyy7CzKzoIacLPDv9MYGoqICwUpAYVId7a1croifZN192n2OMb7lY37dq 0m4oNiFGeZvjQRGfgGJv0jdUg1kYUGfjDLhlPEtoVfr6l4r/IlAzwqz14poATtsY1DuH PdevAZqKxil64SOHtrFePfsShLHNgKdMdzfOy2swQqsMocsvqD/1xafD3SqHIZaGyy4/ Wi+F+vVhRnU/+dFjl1ecYPX8Iijeeva+mxGnXLha9NlLuPSBPaRf8tTq7ONkQYMVpkJC txGg== X-Gm-Message-State: ALoCoQkOe1JjQV5YI4xonS9tHhvMGQ5AcX1k/SYMdhNqY/5xAgihlQJg42LCVZ1YP27pneEQPn+G X-Received: by 10.236.26.209 with SMTP id c57mr231586yha.9.1392886920630; Thu, 20 Feb 2014 01:02:00 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.202 with SMTP id z68ls476567qgz.85.gmail; Thu, 20 Feb 2014 01:02:00 -0800 (PST) X-Received: by 10.52.102.235 with SMTP id fr11mr264009vdb.51.1392886920479; Thu, 20 Feb 2014 01:02:00 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ke3si1198621veb.103.2014.02.20.01.02.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 01:02:00 -0800 (PST) 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 ie18so1580567vcb.12 for ; Thu, 20 Feb 2014 01:02:00 -0800 (PST) X-Received: by 10.220.225.71 with SMTP id ir7mr361022vcb.50.1392886920135; Thu, 20 Feb 2014 01:02:00 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp40935vcz; Thu, 20 Feb 2014 01:01:59 -0800 (PST) X-Received: by 10.66.240.4 with SMTP id vw4mr830233pac.26.1392886919329; Thu, 20 Feb 2014 01:01:59 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si2635386pbl.41.2014.02.20.01.01.58; Thu, 20 Feb 2014 01:01:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755049AbaBTI7r (ORCPT + 26 others); Thu, 20 Feb 2014 03:59:47 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:42219 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755009AbaBTI7o (ORCPT ); Thu, 20 Feb 2014 03:59:44 -0500 Received: by mail-pa0-f47.google.com with SMTP id kp14so1625999pab.34 for ; Thu, 20 Feb 2014 00:59:42 -0800 (PST) X-Received: by 10.68.176.65 with SMTP id cg1mr596718pbc.145.1392886782910; Thu, 20 Feb 2014 00:59:42 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id eo11sm21100112pac.0.2014.02.20.00.59.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 00:59:42 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, sachin.kamat@linaro.org, Graeme Gregory Subject: [PATCH 18/23] regulator: tps65910: Remove redundant error message Date: Thu, 20 Feb 2014 14:23:18 +0530 Message-Id: <1392886403-10640-18-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392886403-10640-1-git-send-email-sachin.kamat@linaro.org> References: <1392886403-10640-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat Cc: Graeme Gregory --- drivers/regulator/tps65910-regulator.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index f50dd847eebc..fa7db8847578 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c @@ -1011,11 +1011,8 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( pmic_plat_data = devm_kzalloc(&pdev->dev, sizeof(*pmic_plat_data), GFP_KERNEL); - - if (!pmic_plat_data) { - dev_err(&pdev->dev, "Failure to alloc pdata for regulators.\n"); + if (!pmic_plat_data) return NULL; - } np = of_node_get(pdev->dev.parent->of_node); regulators = of_get_child_by_name(np, "regulators"); @@ -1098,10 +1095,8 @@ static int tps65910_probe(struct platform_device *pdev) } pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); - if (!pmic) { - dev_err(&pdev->dev, "Memory allocation failed for pmic\n"); + if (!pmic) return -ENOMEM; - } pmic->mfd = tps65910; platform_set_drvdata(pdev, pmic); @@ -1130,24 +1125,18 @@ static int tps65910_probe(struct platform_device *pdev) pmic->desc = devm_kzalloc(&pdev->dev, pmic->num_regulators * sizeof(struct regulator_desc), GFP_KERNEL); - if (!pmic->desc) { - dev_err(&pdev->dev, "Memory alloc fails for desc\n"); + if (!pmic->desc) return -ENOMEM; - } pmic->info = devm_kzalloc(&pdev->dev, pmic->num_regulators * sizeof(struct tps_info *), GFP_KERNEL); - if (!pmic->info) { - dev_err(&pdev->dev, "Memory alloc fails for info\n"); + if (!pmic->info) return -ENOMEM; - } pmic->rdev = devm_kzalloc(&pdev->dev, pmic->num_regulators * sizeof(struct regulator_dev *), GFP_KERNEL); - if (!pmic->rdev) { - dev_err(&pdev->dev, "Memory alloc fails for rdev\n"); + if (!pmic->rdev) return -ENOMEM; - } for (i = 0; i < pmic->num_regulators && i < TPS65910_NUM_REGS; i++, info++) {