diff mbox series

[02/20] net: phy: xilinx: Convert to use APIs which support live DT

Message ID 20210302153451.19440-3-bmeng.cn@gmail.com
State Superseded
Delegated to: Priyanka Jain
Headers show
Series ppc: qemu: Add eTSEC support | expand

Commit Message

Bin Meng March 2, 2021, 3:34 p.m. UTC
Use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver
can support live DT.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/net/phy/phy.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

Comments

Vladimir Oltean March 2, 2021, 3:40 p.m. UTC | #1
Hi Bin,

On Tue, Mar 02, 2021 at 11:34:33PM +0800, Bin Meng wrote:
> Use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver
> can support live DT.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---

Nice to see you work on this, but did you see my patches?
https://patchwork.ozlabs.org/project/uboot/patch/20210216224804.3355044-2-olteanv@gmail.com/
Ramon Fried March 2, 2021, 5:51 p.m. UTC | #2
On Tue, Mar 2, 2021 at 5:35 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver
> can support live DT.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/net/phy/phy.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index d9e03baf7b..f0522fc149 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -947,23 +947,18 @@ static struct phy_device *phy_connect_gmii2rgmii(struct mii_dev *bus,
>                                                  phy_interface_t interface)
>  {
>         struct phy_device *phydev = NULL;
> -       int sn = dev_of_offset(dev);
> -       int off;
> +       ofnode node = dev_ofnode(dev);
>
> -       while (sn > 0) {
> -               off = fdt_node_offset_by_compatible(gd->fdt_blob, sn,
> -                                                   "xlnx,gmii-to-rgmii-1.0");
> -               if (off > 0) {
> -                       phydev = phy_device_create(bus, off,
> +       while (ofnode_valid(node)) {
> +               node = ofnode_by_compatible(node, "xlnx,gmii-to-rgmii-1.0");
> +               if (ofnode_valid(node)) {
> +                       phydev = phy_device_create(bus, ofnode_to_offset(node),
>                                                    PHY_GMII2RGMII_ID, false,
>                                                    interface);
>                         break;
>                 }
> -               if (off == -FDT_ERR_NOTFOUND)
> -                       sn = fdt_first_subnode(gd->fdt_blob, sn);
> -               else
> -                       printf("%s: Error finding compat string:%d\n",
> -                              __func__, off);
> +
> +               node = ofnode_first_subnode(node);
>         }
>
>         return phydev;
> --
> 2.25.1
>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
Bin Meng March 4, 2021, 5:36 a.m. UTC | #3
Hi Vladimir,

On Tue, Mar 2, 2021 at 11:40 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> Hi Bin,
>
> On Tue, Mar 02, 2021 at 11:34:33PM +0800, Bin Meng wrote:
> > Use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver
> > can support live DT.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
>
> Nice to see you work on this, but did you see my patches?

I apparently missed your patches.

> https://patchwork.ozlabs.org/project/uboot/patch/20210216224804.3355044-2-olteanv@gmail.com/

It looks that I need to rebase my series on top of yours?

Regards,
Bin
Vladimir Oltean March 4, 2021, 11:05 p.m. UTC | #4
On Thu, Mar 04, 2021 at 01:36:45PM +0800, Bin Meng wrote:
> It looks that I need to rebase my series on top of yours?

That would be nice, thank you. It would also create some sort of
incentive to finally get my patches accepted or at least looked at, they
are in the 'Needs Review/Ack' state, you seem to be quite the adequate
person for that :)
Bin Meng March 11, 2021, 10:33 a.m. UTC | #5
Hi Vladimir,

On Fri, Mar 5, 2021 at 7:05 AM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> On Thu, Mar 04, 2021 at 01:36:45PM +0800, Bin Meng wrote:
> > It looks that I need to rebase my series on top of yours?
>
> That would be nice, thank you. It would also create some sort of
> incentive to finally get my patches accepted or at least looked at, they
> are in the 'Needs Review/Ack' state, you seem to be quite the adequate
> person for that :)

I want to include your series as part of my v2 series, to remove
dependencies for different maintainers.

Are you okay with this?

Regards,
Bin
Vladimir Oltean March 11, 2021, 10:37 a.m. UTC | #6
On Thu, Mar 11, 2021 at 06:33:39PM +0800, Bin Meng wrote:
> Hi Vladimir,
> 
> On Fri, Mar 5, 2021 at 7:05 AM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> >
> > On Thu, Mar 04, 2021 at 01:36:45PM +0800, Bin Meng wrote:
> > > It looks that I need to rebase my series on top of yours?
> >
> > That would be nice, thank you. It would also create some sort of
> > incentive to finally get my patches accepted or at least looked at, they
> > are in the 'Needs Review/Ack' state, you seem to be quite the adequate
> > person for that :)
> 
> I want to include your series as part of my v2 series, to remove
> dependencies for different maintainers.
> 
> Are you okay with this?
> 
> Regards,
> Bin

Priyanka already merged your series and sent the pull request to Tom,
frankly I don't think there's anything more for you to do.
Bin Meng March 11, 2021, 10:58 a.m. UTC | #7
Hi Vladimir,

On Thu, Mar 11, 2021 at 6:37 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> On Thu, Mar 11, 2021 at 06:33:39PM +0800, Bin Meng wrote:
> > Hi Vladimir,
> >
> > On Fri, Mar 5, 2021 at 7:05 AM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> > >
> > > On Thu, Mar 04, 2021 at 01:36:45PM +0800, Bin Meng wrote:
> > > > It looks that I need to rebase my series on top of yours?
> > >
> > > That would be nice, thank you. It would also create some sort of
> > > incentive to finally get my patches accepted or at least looked at, they
> > > are in the 'Needs Review/Ack' state, you seem to be quite the adequate
> > > person for that :)
> >
> > I want to include your series as part of my v2 series, to remove
> > dependencies for different maintainers.
> >
> > Are you okay with this?
> >
> > Regards,
> > Bin
>
> Priyanka already merged your series and sent the pull request to Tom,
> frankly I don't think there's anything more for you to do.

I did not see that. Did you mean the previous qemu ppc series?

Regards,
Bin
Vladimir Oltean March 11, 2021, 11:02 a.m. UTC | #8
On Thu, Mar 11, 2021 at 06:58:33PM +0800, Bin Meng wrote:
> Hi Vladimir,
>
> On Thu, Mar 11, 2021 at 6:37 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> >
> > On Thu, Mar 11, 2021 at 06:33:39PM +0800, Bin Meng wrote:
> > > Hi Vladimir,
> > >
> > > On Fri, Mar 5, 2021 at 7:05 AM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> > > >
> > > > On Thu, Mar 04, 2021 at 01:36:45PM +0800, Bin Meng wrote:
> > > > > It looks that I need to rebase my series on top of yours?
> > > >
> > > > That would be nice, thank you. It would also create some sort of
> > > > incentive to finally get my patches accepted or at least looked at, they
> > > > are in the 'Needs Review/Ack' state, you seem to be quite the adequate
> > > > person for that :)
> > >
> > > I want to include your series as part of my v2 series, to remove
> > > dependencies for different maintainers.
> > >
> > > Are you okay with this?
> > >
> > > Regards,
> > > Bin
> >
> > Priyanka already merged your series and sent the pull request to Tom,
> > frankly I don't think there's anything more for you to do.
>
> I did not see that. Did you mean the previous qemu ppc series?

Ah, the series for the eTSEC in QEMU was different than the one for
e500? Ok, in that case I'm wrong, your networking patches were not
merged yet.

If you could pick up my patches that would be nice. Let me know if
there's anything I can help with.
diff mbox series

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index d9e03baf7b..f0522fc149 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -947,23 +947,18 @@  static struct phy_device *phy_connect_gmii2rgmii(struct mii_dev *bus,
 						 phy_interface_t interface)
 {
 	struct phy_device *phydev = NULL;
-	int sn = dev_of_offset(dev);
-	int off;
+	ofnode node = dev_ofnode(dev);
 
-	while (sn > 0) {
-		off = fdt_node_offset_by_compatible(gd->fdt_blob, sn,
-						    "xlnx,gmii-to-rgmii-1.0");
-		if (off > 0) {
-			phydev = phy_device_create(bus, off,
+	while (ofnode_valid(node)) {
+		node = ofnode_by_compatible(node, "xlnx,gmii-to-rgmii-1.0");
+		if (ofnode_valid(node)) {
+			phydev = phy_device_create(bus, ofnode_to_offset(node),
 						   PHY_GMII2RGMII_ID, false,
 						   interface);
 			break;
 		}
-		if (off == -FDT_ERR_NOTFOUND)
-			sn = fdt_first_subnode(gd->fdt_blob, sn);
-		else
-			printf("%s: Error finding compat string:%d\n",
-			       __func__, off);
+
+		node = ofnode_first_subnode(node);
 	}
 
 	return phydev;