From patchwork Thu Jan 7 08:31:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roosen Henri X-Patchwork-Id: 564195 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 F39F9140291 for ; Thu, 7 Jan 2016 19:32:30 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbcAGIcO (ORCPT ); Thu, 7 Jan 2016 03:32:14 -0500 Received: from mail.ginzinger.com ([31.193.165.229]:7726 "EHLO mail.ginzinger.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbcAGIcM (ORCPT ); Thu, 7 Jan 2016 03:32:12 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ginzinger.com (Postfix) with ESMTP id 423752460E; Thu, 7 Jan 2016 09:32:10 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.1 (20080629) (Debian) at ginzinger.com Received: from mail.ginzinger.com ([127.0.0.1]) by localhost (mail.ginzinger.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jWjUgSRa5FKW; Thu, 7 Jan 2016 09:32:10 +0100 (CET) Received: from exc2.buero.ginzinger.com (exc2.buero.ginzinger.com [10.1.1.201]) by mail.ginzinger.com (Postfix) with ESMTPS id 112E42460A; Thu, 7 Jan 2016 09:32:10 +0100 (CET) Received: from EN-PC16.buero.ginzinger.com (10.2.1.65) by exc2.buero.ginzinger.com (10.1.1.201) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 7 Jan 2016 09:32:10 +0100 From: Henri Roosen To: CC: , , , Henri Roosen Subject: [PATCH v3 1/1] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031. Date: Thu, 7 Jan 2016 09:31:15 +0100 Message-ID: <1452155475-7742-1-git-send-email-henri.roosen@ginzinger.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Originating-IP: [10.2.1.65] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 651df2183543 ("phy: micrel: Fix finding PHY properties in MAC node.") only fixes finding PHY properties in MAC node for KSZ9021. This commit applies the same fix for KSZ9031. Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.") Acked-by: Andrew Lunn Signed-off-by: Henri Roosen --- Changes since v2: - removed unnecessary empty line drivers/net/phy/micrel.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index e13ad6c..7a56799 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -470,9 +470,17 @@ static int ksz9031_config_init(struct phy_device *phydev) "txd2-skew-ps", "txd3-skew-ps" }; static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"}; + const struct device *dev_walker; - if (!of_node && dev->parent->of_node) - of_node = dev->parent->of_node; + /* The Micrel driver has a deprecated option to place phy OF + * properties in the MAC node. Walk up the tree of devices to + * find a device with an OF node. + */ + dev_walker = &phydev->dev; + do { + of_node = dev_walker->of_node; + dev_walker = dev_walker->parent; + } while (!of_node && dev_walker); if (of_node) { ksz9031_of_load_skew_values(phydev, of_node,