Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1461715
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: macb: add phy-handle support for the macb |
| Date | 2016-08-14 11:00 +0200 |
| Message-ID | <s5ZqW-5AD-9@gated-at.bofh.it> (permalink) |
| References | <s5ZqW-5AD-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH] net: macb: add phy-handle support for the macb David Miller <davem@davemloft.net> - 2016-08-14 11:00 +0200 Re: [PATCH] net: macb: add phy-handle support for the macb Andrew Lunn <andrew@lunn.ch> - 2016-08-16 22:20 +0200
csiph-web