From: David Miller <davem@davemloft.net>
To: appana.durga.rao@xilinx.com
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
nicolas.ferre@atmel.com, sergio.prado@e-labworks.com,
gregory.clement@free-electrons.com, narmstrong@baylibre.com,
michal.simek@xilinx.com, appanad@xilinx.com,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: macb: add phy-handle support for the macb
Date: Sat, 13 Aug 2016 11:52:22 -0700 (PDT) [thread overview]
Message-ID: <20160813.115222.443333178659469072.davem@davemloft.net> (raw)
In-Reply-To: <1471082509-11764-1-git-send-email-appanad@xilinx.com>
From: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
Date: Sat, 13 Aug 2016 15:31:49 +0530
> @@ -445,7 +445,13 @@ static int macb_mii_init(struct macb *bp)
> dev_set_drvdata(&bp->dev->dev, bp->mii_bus);
>
> np = bp->pdev->dev.of_node;
> - if (np) {
> + np1 = of_get_parent(bp->phy_node);
> + if (np1) {
> + of_node_put(np1);
> + err = of_mdiobus_register(bp->mii_bus, np1);
> + if (err)
> + goto err_out_unregister_bus;
> + } else if (np) {
I don't know about this, all OF nodes other than the root have a
parent node which is non-NULL. This parent node can be anything.
Just blinding assuming that any parent node of the phy_node is
what we are looking for, without any other supplementary checks
at all, seems to be asking for trouble at the very least.
next prev parent reply other threads:[~2016-08-13 18:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-13 10:01 [PATCH] net: macb: add phy-handle support for the macb Kedareswara rao Appana
2016-08-13 18:52 ` David Miller [this message]
2016-08-16 7:01 ` Appana Durga Kedareswara Rao
2016-08-16 20:14 ` Andrew Lunn
[not found] ` <20160816201436.GB3751-g2DYL2Zd6BY@public.gmane.org>
2016-08-18 15:53 ` Appana Durga Kedareswara Rao
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=20160813.115222.443333178659469072.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=appana.durga.rao@xilinx.com \
--cc=appanad@xilinx.com \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michal.simek@xilinx.com \
--cc=narmstrong@baylibre.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=robh+dt@kernel.org \
--cc=sergio.prado@e-labworks.com \
/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).