From patchwork Tue Aug 7 16:51:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 175750 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4C9042C0090 for ; Wed, 8 Aug 2012 02:51:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755591Ab2HGQvS (ORCPT ); Tue, 7 Aug 2012 12:51:18 -0400 Received: from db3ehsobe004.messaging.microsoft.com ([213.199.154.142]:19143 "EHLO db3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755018Ab2HGQvR (ORCPT ); Tue, 7 Aug 2012 12:51:17 -0400 Received: from mail42-db3-R.bigfish.com (10.3.81.240) by DB3EHSOBE007.bigfish.com (10.3.84.27) with Microsoft SMTP Server id 14.1.225.23; Tue, 7 Aug 2012 16:51:16 +0000 Received: from mail42-db3 (localhost [127.0.0.1]) by mail42-db3-R.bigfish.com (Postfix) with ESMTP id 09D0648030A; Tue, 7 Aug 2012 16:51:16 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bhf0ah107ah) Received: from mail42-db3 (localhost.localdomain [127.0.0.1]) by mail42-db3 (MessageSwitch) id 1344358273213999_12495; Tue, 7 Aug 2012 16:51:13 +0000 (UTC) Received: from DB3EHSMHS009.bigfish.com (unknown [10.3.81.247]) by mail42-db3.bigfish.com (Postfix) with ESMTP id 2FB7410003F; Tue, 7 Aug 2012 16:51:13 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS009.bigfish.com (10.3.87.109) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 7 Aug 2012 16:51:09 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.298.5; Tue, 7 Aug 2012 11:51:07 -0500 Received: from efes.am.freescale.net (efes.am.freescale.net [10.82.123.3]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q77Gp7Lv006116; Tue, 7 Aug 2012 09:51:07 -0700 From: Timur Tabi To: , David Miller , Subject: [PATCH] netdev/phy: skip disabled mdio-mux nodes Date: Tue, 7 Aug 2012 11:51:06 -0500 Message-ID: <1344358266-5450-1-git-send-email-timur@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The mdio-mux driver scans all child mdio nodes, without regard to whether the node is actually used. Some device trees include all possible mdio-mux nodes and rely on the boot loader to disable those that are not present, based on some run-time configuration. Those nodes need to be skipped. Signed-off-by: Timur Tabi --- drivers/net/phy/mdio-mux.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c index 5c12018..d0c231e 100644 --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c @@ -135,6 +135,15 @@ int mdio_mux_init(struct device *dev, for_each_child_of_node(dev->of_node, child_bus_node) { u32 v; + /* + * Some device trees include all possible mdio-mux nodes and + * rely on the boot loader to disable those that are not + * present, based on some run-time configuration. Those nodes + * need to be skipped. + */ + if (!of_device_is_available(child_bus_node)) + continue; + r = of_property_read_u32(child_bus_node, "reg", &v); if (r) continue;