From patchwork Wed Sep 21 11:10:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4215 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1655623F6F for ; Wed, 21 Sep 2011 11:01:58 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0B59BA189D1 for ; Wed, 21 Sep 2011 11:01:58 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so2119337fxe.11 for ; Wed, 21 Sep 2011 04:01:58 -0700 (PDT) Received: by 10.223.74.89 with SMTP id t25mr880518faj.65.1316602917925; Wed, 21 Sep 2011 04:01:57 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs121588lad; Wed, 21 Sep 2011 04:01:57 -0700 (PDT) Received: by 10.224.187.144 with SMTP id cw16mr506539qab.155.1316602916854; Wed, 21 Sep 2011 04:01:56 -0700 (PDT) Received: from TX2EHSOBE010.bigfish.com (tx2ehsobe005.messaging.microsoft.com. [65.55.88.15]) by mx.google.com with ESMTPS id z11si372171qcv.118.2011.09.21.04.01.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 04:01:56 -0700 (PDT) Received-SPF: neutral (google.com: 65.55.88.15 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=65.55.88.15; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.15 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail180-tx2-R.bigfish.com (10.9.14.251) by TX2EHSOBE010.bigfish.com (10.9.40.30) with Microsoft SMTP Server id 14.1.225.22; Wed, 21 Sep 2011 11:01:55 +0000 Received: from mail180-tx2 (localhost.localdomain [127.0.0.1]) by mail180-tx2-R.bigfish.com (Postfix) with ESMTP id E91C91018375; Wed, 21 Sep 2011 11:01:54 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail180-tx2 (localhost.localdomain [127.0.0.1]) by mail180-tx2 (MessageSwitch) id 1316602863622853_30906; Wed, 21 Sep 2011 11:01:03 +0000 (UTC) Received: from TX2EHSMHS047.bigfish.com (unknown [10.9.14.241]) by mail180-tx2.bigfish.com (Postfix) with ESMTP id E21A31A8061; Wed, 21 Sep 2011 11:01:01 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS047.bigfish.com (10.9.99.147) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 21 Sep 2011 11:01:00 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.7; Wed, 21 Sep 2011 06:00:59 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p8LB0oW5020827; Wed, 21 Sep 2011 06:00:57 -0500 (CDT) From: Shawn Guo To: "David S. Miller" CC: Francois Romieu , =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= , Troy Kisky , , , , Shawn Guo Subject: [PATCH v2 2/3] net/fec: fix fec1 check in fec_enet_mii_init() Date: Wed, 21 Sep 2011 19:10:31 +0800 Message-ID: <1316603432-20032-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316603432-20032-1-git-send-email-shawn.guo@linaro.org> References: <1316603432-20032-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com In function fec_enet_mii_init(), it uses non-zero pdev->id as part of the condition to check the second fec instance (fec1). This works before the driver supports device tree probe. But in case of device tree probe, pdev->id is -1 which is also non-zero, so the logic becomes broken when device tree probe gets supported. The patch change the logic to check "pdev->id > 0" as the part of the condition for identifying fec1. Signed-off-by: Shawn Guo --- drivers/net/ethernet/freescale/fec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index a057abf..ca6f551 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -996,7 +996,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) * mdio interface in board design, and need to be configured by * fec0 mii_bus. */ - if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) { + if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) { /* fec1 uses fec0 mii_bus */ fep->mii_bus = fec0_mii_bus; return 0;