From patchwork Tue Sep 16 17:58:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 4919441 Return-Path: X-Original-To: patchwork-linux-arm@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 15C5EBEEA5 for ; Tue, 16 Sep 2014 19:04:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDEF92010E for ; Tue, 16 Sep 2014 19:04:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76D1B2015D for ; Tue, 16 Sep 2014 19:04:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XTy1V-0004WK-7G; Tue, 16 Sep 2014 19:02:45 +0000 Received: from mail-bn1bbn0105.outbound.protection.outlook.com ([157.56.111.105] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XTy1R-0004Lx-N2 for linux-arm-kernel@lists.infradead.org; Tue, 16 Sep 2014 19:02:42 +0000 Received: from BN3PR0301CA0074.namprd03.prod.outlook.com (25.160.152.170) by BL2PR03MB370.namprd03.prod.outlook.com (10.141.89.13) with Microsoft SMTP Server (TLS) id 15.0.1029.13; Tue, 16 Sep 2014 19:02:17 +0000 Received: from BL2FFO11FD037.protection.gbl (2a01:111:f400:7c09::147) by BN3PR0301CA0074.outlook.office365.com (2a01:111:e400:401e::42) with Microsoft SMTP Server (TLS) id 15.0.1029.13 via Frontend Transport; Tue, 16 Sep 2014 19:02:17 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD037.mail.protection.outlook.com (10.173.161.133) with Microsoft SMTP Server (TLS) id 15.0.1019.14 via Frontend Transport; Tue, 16 Sep 2014 19:02:17 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s8GJ25Wc013941; Tue, 16 Sep 2014 12:02:14 -0700 From: To: , , , Subject: [Patch net-next v2 1/4] net: fec: refine error handle of parser queue number from DT Date: Wed, 17 Sep 2014 01:58:07 +0800 Message-ID: <1410890290-11248-2-git-send-email-Frank.Li@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410890290-11248-1-git-send-email-Frank.Li@freescale.com> References: <1410890290-11248-1-git-send-email-Frank.Li@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(86362001)(19580395003)(62966002)(26826002)(87286001)(93916002)(68736004)(44976005)(85852003)(20776003)(86152002)(84676001)(47776003)(2201001)(64706001)(83322001)(95666004)(99396002)(92566001)(89996001)(85306004)(83072002)(104016003)(90102001)(107046002)(50986999)(77156001)(48376002)(106466001)(104166001)(92726001)(87936001)(229853001)(21056001)(76176999)(88136002)(97736003)(50466002)(36756003)(102836001)(6806004)(19580405001)(4396001)(31966008)(46102003)(74662003)(79102003)(80022003)(74502003)(81342003)(77982003)(81542003)(105606002)(76482001)(50226001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB370; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 03361FCC43 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Frank.Li@freescale.com; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140916_120241_909523_E6B6EA20 X-CRM114-Status: UNSURE ( 7.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.4 (/) Cc: shawn.guo@linaro.org, Frank Li , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Frank Li check tx and rx queue seperately. fix typo, "Invalidate" and "fail". change pr_err to pr_warn. Signed-off-by: Frank Li --- drivers/net/ethernet/freescale/fec_main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 8f8e55e..d209d2e 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2890,23 +2890,23 @@ fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx) /* parse the num of tx and rx queues */ err = of_property_read_u32(np, "fsl,num-tx-queues", num_tx); - err |= of_property_read_u32(np, "fsl,num-rx-queues", num_rx); - if (err) { + if (err) *num_tx = 1; + + err = of_property_read_u32(np, "fsl,num-rx-queues", num_rx); + if (err) *num_rx = 1; - return; - } if (*num_tx < 1 || *num_tx > FEC_ENET_MAX_TX_QS) { - dev_err(&pdev->dev, "Invalidate num_tx(=%d), fail back to 1\n", - *num_tx); + dev_warn(&pdev->dev, "Invalid num_tx(=%d), fall back to 1\n", + *num_tx); *num_tx = 1; return; } if (*num_rx < 1 || *num_rx > FEC_ENET_MAX_RX_QS) { - dev_err(&pdev->dev, "Invalidate num_rx(=%d), fail back to 1\n", - *num_rx); + dev_warn(&pdev->dev, "Invalid num_rx(=%d), fall back to 1\n", + *num_rx); *num_rx = 1; return; } @@ -2924,8 +2924,8 @@ fec_probe(struct platform_device *pdev) const struct of_device_id *of_id; static int dev_id; struct device_node *np = pdev->dev.of_node, *phy_node; - int num_tx_qs = 1; - int num_rx_qs = 1; + int num_tx_qs; + int num_rx_qs; of_id = of_match_device(fec_dt_ids, &pdev->dev); if (of_id)