From patchwork Fri Jul 17 07:31:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 29904 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4A46EB856E for ; Fri, 17 Jul 2009 17:32:04 +1000 (EST) Received: by ozlabs.org (Postfix) id 30DF4DDD1C; Fri, 17 Jul 2009 17:32:04 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B14C0DDD01 for ; Fri, 17 Jul 2009 17:32:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934172AbZGQHbu (ORCPT ); Fri, 17 Jul 2009 03:31:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934170AbZGQHbu (ORCPT ); Fri, 17 Jul 2009 03:31:50 -0400 Received: from mail-pz0-f197.google.com ([209.85.222.197]:52484 "EHLO mail-pz0-f197.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934169AbZGQHbt (ORCPT ); Fri, 17 Jul 2009 03:31:49 -0400 Received: by mail-pz0-f197.google.com with SMTP id 35so477161pzk.33 for ; Fri, 17 Jul 2009 00:31:49 -0700 (PDT) Received: by 10.115.94.4 with SMTP id w4mr1112039wal.153.1247815909607; Fri, 17 Jul 2009 00:31:49 -0700 (PDT) Received: from trillian.cg.shawcable.net (S01060016b61d1226.cg.shawcable.net [68.146.92.145]) by mx.google.com with ESMTPS id m6sm1803667wag.49.2009.07.17.00.31.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 00:31:48 -0700 (PDT) Received: from localhost.localdomain (trillian [127.0.0.1]) by trillian.cg.shawcable.net (Postfix) with ESMTP id 503F2C80C1; Fri, 17 Jul 2009 01:31:47 -0600 (MDT) From: Grant Likely Subject: [PATCH v2 4/4] ucc_geth: Revive fixed link support To: avorontsov@ru.mvista.com, davem@davemloft.net, afleming@freescale.com, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: leoli@freescale.com Date: Fri, 17 Jul 2009 01:31:47 -0600 Message-ID: <20090717073147.15652.21395.stgit@localhost.localdomain> In-Reply-To: <20090717065220.15652.93331.stgit@localhost.localdomain> References: <20090717065220.15652.93331.stgit@localhost.localdomain> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Anton Vorontsov Since commit 0b9da337dca972e7a4144e298ec3adb8f244d4a4 ("Rework ucc_geth driver to use of_mdio infrastructure") the fixed-link support is broken. This patch fixes the support by removing !ug_info->phy_node check, and adds a call to of_phy_connect_fixed_link() if a phy is not attached to the MAC. Also, remove an old fixed-link code that we don't use any longer. Signed-off-by: Anton Vorontsov Signed-off-by: Grant Likely --- drivers/net/ucc_geth.c | 23 +++++++---------------- 1 files changed, 7 insertions(+), 16 deletions(-) -- 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 diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 40c6eba..3b957e6 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -1590,13 +1590,13 @@ static int init_phy(struct net_device *dev) priv->oldspeed = 0; priv->oldduplex = -1; - if (!ug_info->phy_node) - return 0; - phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, priv->phy_interface); + if (!phydev) + phydev = of_phy_connect_fixed_link(dev, &adjust_link, + priv->phy_interface); if (!phydev) { - printk("%s: Could not attach to PHY\n", dev->name); + dev_err(&dev->dev, "Could not attach to PHY\n"); return -ENODEV; } @@ -3608,9 +3608,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma struct ucc_geth_private *ugeth = NULL; struct ucc_geth_info *ug_info; struct resource res; - struct device_node *phy; int err, ucc_num, max_speed = 0; - const u32 *fixed_link; const unsigned int *prop; const char *sprop; const void *mac_addr; @@ -3708,15 +3706,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma ug_info->uf_info.regs = res.start; ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); - fixed_link = of_get_property(np, "fixed-link", NULL); - if (fixed_link) { - phy = NULL; - } else { - phy = of_parse_phandle(np, "phy-handle", 0); - if (phy == NULL) - return -ENODEV; - } - ug_info->phy_node = phy; + + ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0); /* Find the TBI PHY node. If it's not there, we don't support SGMII */ ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); @@ -3725,7 +3716,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma prop = of_get_property(np, "phy-connection-type", NULL); if (!prop) { /* handle interface property present in old trees */ - prop = of_get_property(phy, "interface", NULL); + prop = of_get_property(ug_info->phy_node, "interface", NULL); if (prop != NULL) { phy_interface = enet_to_phy_interface[*prop]; max_speed = enet_to_speed[*prop];