From: Florian Fainelli <f.fainelli@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Grygorii Strashko <grygorii.strashko@ti.com>,
"David S . Miller" <davem@davemloft.net>,
Dan Carpenter <dan.carpenter@oracle.com>,
Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
Rob Herring <robh@kernel.org>, Lukas Wunner <lukas@wunner.de>,
Kevin Hilman <khilman@kernel.org>,
David Lechner <david@lechnology.com>,
Sekhar Nori <nsekhar@ti.com>, Andrew Lunn <andrew@lunn.ch>
Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 2/3] net: phy: set the of_node in the mdiodev's struct device
Date: Tue, 19 Jun 2018 09:55:54 -0700 [thread overview]
Message-ID: <284f2e59-da97-e907-690e-f75de376ff62@gmail.com> (raw)
In-Reply-To: <20180619160950.6283-3-brgl@bgdev.pl>
On 06/19/2018 09:09 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Copy the of_node over from mii_bus's struct device. This is needed
> for device-tree systems to be able to check the mdio device's
> compatible string.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
> drivers/net/phy/phy_device.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index bd0f339f69fd..a92d5ee61813 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -411,6 +411,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
> mdiodev->dev.parent = &bus->dev;
> mdiodev->dev.bus = &mdio_bus_type;
> mdiodev->dev.type = &mdio_bus_phy_type;
> + mdiodev->dev.of_node = bus->dev.of_node;
That does not quite make sense to me, the mdio device's parent already
points to &bus->dev, which would get you the correct of_node. You are
breaking the parent/child relationship here. From patch 3, see my
comments there, it does not look like you are matching on the right
device level.
> mdiodev->bus = bus;
> mdiodev->bus_match = phy_bus_match;
> mdiodev->addr = addr;
>
--
Florian
next prev parent reply other threads:[~2018-06-19 16:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-19 16:09 [PATCH 0/3] net: davinci_emac: fix suspend/resume (both a regression and a common clk problem) Bartosz Golaszewski
2018-06-19 16:09 ` [PATCH 1/3] net: ethernet: fix suspend/resume in davinci_emac Bartosz Golaszewski
2018-06-19 16:55 ` Florian Fainelli
2018-06-20 7:56 ` Bartosz Golaszewski
2018-06-19 18:00 ` Lukas Wunner
2018-06-19 16:09 ` [PATCH 2/3] net: phy: set the of_node in the mdiodev's struct device Bartosz Golaszewski
2018-06-19 16:55 ` Florian Fainelli [this message]
2018-06-19 16:09 ` [PATCH 3/3] net: davinci_emac: match the mdio device against its compatible if possible Bartosz Golaszewski
2018-06-19 16:56 ` Florian Fainelli
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=284f2e59-da97-e907-690e-f75de376ff62@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=david@lechnology.com \
--cc=grygorii.strashko@ti.com \
--cc=ivan.khoronzhuk@linaro.org \
--cc=khilman@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=robh@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).