From patchwork Thu Sep 22 05:10:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4235 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 3974F23F6F for ; Thu, 22 Sep 2011 05:01:02 +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 230E6A18B96 for ; Thu, 22 Sep 2011 05:01:02 +0000 (UTC) Received: by fxe23 with SMTP id 23so3374950fxe.11 for ; Wed, 21 Sep 2011 22:01:02 -0700 (PDT) Received: by 10.223.55.136 with SMTP id u8mr2394387fag.46.1316667661830; Wed, 21 Sep 2011 22:01:01 -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 y6cs154635lad; Wed, 21 Sep 2011 22:01:01 -0700 (PDT) Received: by 10.68.19.100 with SMTP id d4mr1764331pbe.33.1316667659594; Wed, 21 Sep 2011 22:00:59 -0700 (PDT) Received: from VA3EHSOBE004.bigfish.com (va3ehsobe004.messaging.microsoft.com. [216.32.180.14]) by mx.google.com with ESMTPS id n7si1450526pbk.231.2011.09.21.22.00.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 22:00:59 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.180.14 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=216.32.180.14; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.180.14 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail65-va3-R.bigfish.com (10.7.14.242) by VA3EHSOBE004.bigfish.com (10.7.40.24) with Microsoft SMTP Server id 14.1.225.22; Thu, 22 Sep 2011 05:00:57 +0000 Received: from mail65-va3 (localhost.localdomain [127.0.0.1]) by mail65-va3-R.bigfish.com (Postfix) with ESMTP id 84BA9114809B; Thu, 22 Sep 2011 05:00:57 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h63h) X-Spam-TCS-SCL: 2: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 mail65-va3 (localhost.localdomain [127.0.0.1]) by mail65-va3 (MessageSwitch) id 1316667657161750_6036; Thu, 22 Sep 2011 05:00:57 +0000 (UTC) Received: from VA3EHSMHS006.bigfish.com (unknown [10.7.14.240]) by mail65-va3.bigfish.com (Postfix) with ESMTP id 20CE717D005D; Thu, 22 Sep 2011 05:00:57 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS006.bigfish.com (10.7.99.16) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 22 Sep 2011 05:00:53 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.323.7; Thu, 22 Sep 2011 00:00:53 -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 p8M50kN7025656; Thu, 22 Sep 2011 00:00:51 -0500 (CDT) From: Shawn Guo To: "David S. Miller" CC: , , , Shawn Guo Subject: [PATCH v4 2/3] net/fec: fix fec1 check in fec_enet_mii_init() Date: Thu, 22 Sep 2011 13:10:17 +0800 Message-ID: <1316668218-10194-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316668218-10194-1-git-send-email-shawn.guo@linaro.org> References: <1316668218-10194-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 Acked-by: Wolfram Sang --- 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 9c1d059..2bbe6a5 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;