From patchwork Thu Jun 26 03:26:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Qiang X-Patchwork-Id: 364235 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 78CC31400B9 for ; Thu, 26 Jun 2014 13:30:44 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 66D031A071B for ; Thu, 26 Jun 2014 13:30:44 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0207.outbound.protection.outlook.com [207.46.163.207]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 6AF3E1A0006 for ; Thu, 26 Jun 2014 13:30:09 +1000 (EST) Received: from BY2PR03CA037.namprd03.prod.outlook.com (10.242.234.158) by BY2PR03MB394.namprd03.prod.outlook.com (10.141.141.13) with Microsoft SMTP Server (TLS) id 15.0.954.9; Thu, 26 Jun 2014 03:30:02 +0000 Received: from BY2FFO11FD009.protection.gbl (2a01:111:f400:7c0c::132) by BY2PR03CA037.outlook.office365.com (2a01:111:e400:2c2c::30) with Microsoft SMTP Server (TLS) id 15.0.969.15 via Frontend Transport; Thu, 26 Jun 2014 03:30:01 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD009.mail.protection.outlook.com (10.1.14.73) with Microsoft SMTP Server (TLS) id 15.0.969.12 via Frontend Transport; Thu, 26 Jun 2014 03:30:01 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s5Q3TwLd020054; Wed, 25 Jun 2014 20:29:59 -0700 From: Zhao Qiang To: , , , Subject: [PATCH v2] spi: deal with a compile warning Date: Thu, 26 Jun 2014 11:26:43 +0800 Message-ID: <1403753203-13473-1-git-send-email-B45475@freescale.com> X-Mailer: git-send-email 1.8.5 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(62966002)(83072002)(92566001)(64706001)(87286001)(85852003)(26826002)(46102001)(81542001)(104166001)(97736001)(81342001)(92726001)(20776003)(2201001)(76482001)(31966008)(107046002)(102836001)(87936001)(21056001)(36756003)(84676001)(47776003)(4396001)(19580395003)(93916002)(50986999)(74502001)(50226001)(79102001)(19580405001)(74662001)(77982001)(89996001)(88136002)(48376002)(80022001)(77156001)(99396002)(83322001)(106466001)(85306003)(81156004)(68736004)(50466002)(44976005)(6806004)(105606002)(95666004)(69596002)(104016002)(42262001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB394; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 02543CD7CD Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=qiang.zhao@freescale.com; X-OriginatorOrg: freescale.com Cc: Zhao Qiang X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" ret is unused when CONFIG_FSL_SOC defined, so return ret instead of -ENOMEM when the kzalloc fails to avoid it. Signed-off-by: Zhao Qiang --- Changes for v2: -return ret instead of -ENOMEM when the kzalloc fails drivers/spi/spi-fsl-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c index e5d45fc..d40378f 100644 --- a/drivers/spi/spi-fsl-lib.c +++ b/drivers/spi/spi-fsl-lib.c @@ -202,7 +202,7 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev) pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL); if (!pinfo) - return -ENOMEM; + return ret; pdata = &pinfo->pdata; dev->platform_data = pdata;