netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Henri Roosen <henri.roosen@ginzinger.com>
To: <f.fainelli@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<andrew@lunn.ch>, Henri Roosen <henri.roosen@ginzinger.com>
Subject: [PATCH 1/1] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031.
Date: Tue, 22 Dec 2015 11:58:40 +0100	[thread overview]
Message-ID: <1450781920-26912-1-git-send-email-henri.roosen@ginzinger.com> (raw)

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.

Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com>
---
 drivers/net/phy/micrel.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index e13ad6c..fc6c058 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -470,9 +470,18 @@ 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,
--
2.1.4


________________________________

Ginzinger electronic systems GmbH
Gewerbegebiet Pirath 16
4952 Weng im Innkreis
www.ginzinger.com

Firmenbuchnummer: FN 364958d
Firmenbuchgericht: Ried im Innkreis
UID-Nr.: ATU66521089

________________________________
*** WEIHNACHTSURLAUB VON DONNERSTAG, DEN 24. DEZEMBER 2015 BIS MITTWOCH, DEN 6. JAENNER 2016 ***
*** CHRISTMAS VACATION FROM THURSDAY, THE 24 DECEMBER 2015 TO WEDNESDAY, 6 JANUARY 2016 ***

             reply	other threads:[~2015-12-22 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22 10:58 Henri Roosen [this message]
2015-12-22 11:06 ` [PATCH 1/1] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031 Andrew Lunn
2015-12-22 22:14   ` David Miller
2015-12-23  8:11     ` Henri Roosen
2015-12-23 16:37       ` David Miller
2015-12-23  8:42     ` Henri Roosen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450781920-26912-1-git-send-email-henri.roosen@ginzinger.com \
    --to=henri.roosen@ginzinger.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).