From patchwork Thu Nov 29 07:45:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 202681 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 DAC442C0086 for ; Thu, 29 Nov 2012 18:53:24 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752897Ab2K2HxM (ORCPT ); Thu, 29 Nov 2012 02:53:12 -0500 Received: from mail1.sysgo.com ([176.9.26.183]:41116 "EHLO mail1.sysgo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752893Ab2K2HxJ (ORCPT ); Thu, 29 Nov 2012 02:53:09 -0500 X-Greylist: delayed 466 seconds by postgrey-1.27 at vger.kernel.org; Thu, 29 Nov 2012 02:53:09 EST Received: from lantia.sysgo.com (unknown [172.22.2.7]) by mail1.sysgo.com (Postfix) with ESMTP id F109E46189; Thu, 29 Nov 2012 08:45:21 +0100 (CET) Received: by lantia.sysgo.com (Postfix, from userid 113) id D8855F7346; Thu, 29 Nov 2012 08:45:21 +0100 (CET) Received: from [IPv6:::1] (unknown [172.16.10.11]) by lantia.sysgo.com (Postfix) with ESMTP id B6F49F6B30; Thu, 29 Nov 2012 08:45:20 +0100 (CET) Message-ID: <50B71290.2060200@sysgo.com> Date: Thu, 29 Nov 2012 08:45:20 +0100 From: Alexander Sverdlin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: Stephen Warren , devicetree-discuss@lists.ozlabs.org, Rob Herring , Grant Likely CC: alexander sverdlin , w.sang@pengutronix.de, Barry.Song@csr.com, netdev@vger.kernel.org Subject: [PATCH 1/2] of_mdio: Honour "status=disabled" property of device Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Alexander Sverdlin of_mdio: Honour "status=disabled" property of device Currently of_mdiobus_register() function registers all PHY devices, independetly from their status property in device tree. According to "ePAPR 1.1" spec, device should only be registered if there is no "status" property, or it has "ok" (or "okay") value (see of_device_is_available()). In case of "platform devices", of_platform_device_create_pdata() checks for "status" and ensures that disabled devices are not pupulated. But such check for MDIO buses was missing until now. Fix it. Signed-off-by: Alexander Sverdlin --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux.orig/drivers/of/of_mdio.c +++ linux/drivers/of/of_mdio.c @@ -53,7 +53,7 @@ int of_mdiobus_register(struct mii_bus * return rc; /* Loop over the child nodes and register a phy_device for each one */ - for_each_child_of_node(np, child) { + for_each_available_child_of_node(np, child) { const __be32 *paddr; u32 addr; int len;