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: 4425581 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 906C1BEEAA for ; Thu, 26 Jun 2014 03:30:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE8622038C for ; Thu, 26 Jun 2014 03:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D82FC20381 for ; Thu, 26 Jun 2014 03:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755438AbaFZDaG (ORCPT ); Wed, 25 Jun 2014 23:30:06 -0400 Received: from mail-by2lp0237.outbound.protection.outlook.com ([207.46.163.237]:44140 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754834AbaFZDaF (ORCPT ); Wed, 25 Jun 2014 23:30:05 -0400 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: , , , CC: Zhao Qiang 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 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;