diff mbox series

[v1] net: nuvoton: fix build broken for use phy_get_interface_by_name

Message ID 20220913062521.6067-1-JJLIU0@nuvoton.com
State Accepted
Commit dd5f07eb6b7ee3b3a26f5d2403f53c630d6a5b02
Delegated to: Tom Rini
Headers show
Series [v1] net: nuvoton: fix build broken for use phy_get_interface_by_name | expand

Commit Message

Jim Liu Sept. 13, 2022, 6:25 a.m. UTC
The original patch is use phy_get_interface_by_name to set interface.
The new patch is use dev_read_phy_mode to replace it.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
---
 drivers/net/npcm750_eth.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Ramon Fried Sept. 18, 2022, 6:07 a.m. UTC | #1
On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
>
> The original patch is use phy_get_interface_by_name to set interface.
> The new patch is use dev_read_phy_mode to replace it.
>
> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> ---
>  drivers/net/npcm750_eth.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> index 409d5cce4a..bd29a10def 100644
> --- a/drivers/net/npcm750_eth.c
> +++ b/drivers/net/npcm750_eth.c
> @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
>
>         pdata->phy_interface = -1;
>         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> +
>         if (phy_mode)
> -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> -       if (pdata->phy_interface == -1) {
> -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> +               pdata->phy_interface = dev_read_phy_mode(dev);
> +
> +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
>                 return -EINVAL;
> -       }
>
>         pdata->max_speed = 0;
>         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> --
> 2.17.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Jim Liu Nov. 21, 2022, 7:41 a.m. UTC | #2
Hi  Ramon

My upstream topic status is Awaiting Upstream.
What could I do to make it merge fast?

Best regards,
Jim

On Sun, Sep 18, 2022 at 2:07 PM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
> >
> > The original patch is use phy_get_interface_by_name to set interface.
> > The new patch is use dev_read_phy_mode to replace it.
> >
> > Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> > ---
> >  drivers/net/npcm750_eth.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> > index 409d5cce4a..bd29a10def 100644
> > --- a/drivers/net/npcm750_eth.c
> > +++ b/drivers/net/npcm750_eth.c
> > @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
> >
> >         pdata->phy_interface = -1;
> >         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> > +
> >         if (phy_mode)
> > -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> > -       if (pdata->phy_interface == -1) {
> > -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> > +               pdata->phy_interface = dev_read_phy_mode(dev);
> > +
> > +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
> >                 return -EINVAL;
> > -       }
> >
> >         pdata->max_speed = 0;
> >         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> > --
> > 2.17.1
> >
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Jim Liu Dec. 13, 2022, 1:48 a.m. UTC | #3
Hi Tom

My upstream topic status is Awaiting Upstream.
What could I do to make it merge fast?
Your comments are welcome.

Best regards,
Jim

On Mon, Nov 21, 2022 at 3:41 PM Jim Liu <jim.t90615@gmail.com> wrote:
>
> Hi  Ramon
>
> My upstream topic status is Awaiting Upstream.
> What could I do to make it merge fast?
>
> Best regards,
> Jim
>
> On Sun, Sep 18, 2022 at 2:07 PM Ramon Fried <rfried.dev@gmail.com> wrote:
> >
> > On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
> > >
> > > The original patch is use phy_get_interface_by_name to set interface.
> > > The new patch is use dev_read_phy_mode to replace it.
> > >
> > > Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> > > ---
> > >  drivers/net/npcm750_eth.c | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> > > index 409d5cce4a..bd29a10def 100644
> > > --- a/drivers/net/npcm750_eth.c
> > > +++ b/drivers/net/npcm750_eth.c
> > > @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
> > >
> > >         pdata->phy_interface = -1;
> > >         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> > > +
> > >         if (phy_mode)
> > > -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> > > -       if (pdata->phy_interface == -1) {
> > > -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> > > +               pdata->phy_interface = dev_read_phy_mode(dev);
> > > +
> > > +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
> > >                 return -EINVAL;
> > > -       }
> > >
> > >         pdata->max_speed = 0;
> > >         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> > > --
> > > 2.17.1
> > >
> > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tom Rini Dec. 13, 2022, 2:02 a.m. UTC | #4
On Tue, Dec 13, 2022 at 09:48:12AM +0800, Jim Liu wrote:
> Hi Tom
> 
> My upstream topic status is Awaiting Upstream.
> What could I do to make it merge fast?
> Your comments are welcome.

It's in -next now, for v2023.04.  Does this fix some regression already
present in-tree?

> 
> Best regards,
> Jim
> 
> On Mon, Nov 21, 2022 at 3:41 PM Jim Liu <jim.t90615@gmail.com> wrote:
> >
> > Hi  Ramon
> >
> > My upstream topic status is Awaiting Upstream.
> > What could I do to make it merge fast?
> >
> > Best regards,
> > Jim
> >
> > On Sun, Sep 18, 2022 at 2:07 PM Ramon Fried <rfried.dev@gmail.com> wrote:
> > >
> > > On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
> > > >
> > > > The original patch is use phy_get_interface_by_name to set interface.
> > > > The new patch is use dev_read_phy_mode to replace it.
> > > >
> > > > Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> > > > ---
> > > >  drivers/net/npcm750_eth.c | 8 ++++----
> > > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> > > > index 409d5cce4a..bd29a10def 100644
> > > > --- a/drivers/net/npcm750_eth.c
> > > > +++ b/drivers/net/npcm750_eth.c
> > > > @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
> > > >
> > > >         pdata->phy_interface = -1;
> > > >         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> > > > +
> > > >         if (phy_mode)
> > > > -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> > > > -       if (pdata->phy_interface == -1) {
> > > > -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> > > > +               pdata->phy_interface = dev_read_phy_mode(dev);
> > > > +
> > > > +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
> > > >                 return -EINVAL;
> > > > -       }
> > > >
> > > >         pdata->max_speed = 0;
> > > >         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> > > > --
> > > > 2.17.1
> > > >
> > > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Jim Liu Dec. 13, 2022, 2:56 a.m. UTC | #5
Hi Tom

Thanks for your quick response.

I add defconfig patch and found this build error and i2c naming issue.
https://patchwork.ozlabs.org/project/uboot/patch/20220712092407.16567-2-JJLIU0@nuvoton.com/

So I add patch to fix this build error.
-> https://patchwork.ozlabs.org/project/uboot/patch/20220913062521.6067-1-JJLIU0@nuvoton.com/
-> https://patchwork.ozlabs.org/project/uboot/patch/20221121085932.29686-1-JJLIU0@nuvoton.com/

i2c patch is already merged.

Best regards,
Jim

On Tue, Dec 13, 2022 at 10:02 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Tue, Dec 13, 2022 at 09:48:12AM +0800, Jim Liu wrote:
> > Hi Tom
> >
> > My upstream topic status is Awaiting Upstream.
> > What could I do to make it merge fast?
> > Your comments are welcome.
>
> It's in -next now, for v2023.04.  Does this fix some regression already
> present in-tree?
>
> >
> > Best regards,
> > Jim
> >
> > On Mon, Nov 21, 2022 at 3:41 PM Jim Liu <jim.t90615@gmail.com> wrote:
> > >
> > > Hi  Ramon
> > >
> > > My upstream topic status is Awaiting Upstream.
> > > What could I do to make it merge fast?
> > >
> > > Best regards,
> > > Jim
> > >
> > > On Sun, Sep 18, 2022 at 2:07 PM Ramon Fried <rfried.dev@gmail.com> wrote:
> > > >
> > > > On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
> > > > >
> > > > > The original patch is use phy_get_interface_by_name to set interface.
> > > > > The new patch is use dev_read_phy_mode to replace it.
> > > > >
> > > > > Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> > > > > ---
> > > > >  drivers/net/npcm750_eth.c | 8 ++++----
> > > > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > > >
> > > > > diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> > > > > index 409d5cce4a..bd29a10def 100644
> > > > > --- a/drivers/net/npcm750_eth.c
> > > > > +++ b/drivers/net/npcm750_eth.c
> > > > > @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
> > > > >
> > > > >         pdata->phy_interface = -1;
> > > > >         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> > > > > +
> > > > >         if (phy_mode)
> > > > > -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> > > > > -       if (pdata->phy_interface == -1) {
> > > > > -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> > > > > +               pdata->phy_interface = dev_read_phy_mode(dev);
> > > > > +
> > > > > +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
> > > > >                 return -EINVAL;
> > > > > -       }
> > > > >
> > > > >         pdata->max_speed = 0;
> > > > >         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> > > > > --
> > > > > 2.17.1
> > > > >
> > > > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
>
> --
> Tom
Tom Rini Dec. 13, 2022, 3:01 a.m. UTC | #6
On Tue, Dec 13, 2022 at 10:56:49AM +0800, Jim Liu wrote:
> Hi Tom
> 
> Thanks for your quick response.
> 
> I add defconfig patch and found this build error and i2c naming issue.
> https://patchwork.ozlabs.org/project/uboot/patch/20220712092407.16567-2-JJLIU0@nuvoton.com/
> 
> So I add patch to fix this build error.
> -> https://patchwork.ozlabs.org/project/uboot/patch/20220913062521.6067-1-JJLIU0@nuvoton.com/
> -> https://patchwork.ozlabs.org/project/uboot/patch/20221121085932.29686-1-JJLIU0@nuvoton.com/
> 
> i2c patch is already merged.

OK, I'll put it in my list of things to not forget for the next release
as well.

> 
> Best regards,
> Jim
> 
> On Tue, Dec 13, 2022 at 10:02 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Tue, Dec 13, 2022 at 09:48:12AM +0800, Jim Liu wrote:
> > > Hi Tom
> > >
> > > My upstream topic status is Awaiting Upstream.
> > > What could I do to make it merge fast?
> > > Your comments are welcome.
> >
> > It's in -next now, for v2023.04.  Does this fix some regression already
> > present in-tree?
> >
> > >
> > > Best regards,
> > > Jim
> > >
> > > On Mon, Nov 21, 2022 at 3:41 PM Jim Liu <jim.t90615@gmail.com> wrote:
> > > >
> > > > Hi  Ramon
> > > >
> > > > My upstream topic status is Awaiting Upstream.
> > > > What could I do to make it merge fast?
> > > >
> > > > Best regards,
> > > > Jim
> > > >
> > > > On Sun, Sep 18, 2022 at 2:07 PM Ramon Fried <rfried.dev@gmail.com> wrote:
> > > > >
> > > > > On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
> > > > > >
> > > > > > The original patch is use phy_get_interface_by_name to set interface.
> > > > > > The new patch is use dev_read_phy_mode to replace it.
> > > > > >
> > > > > > Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> > > > > > ---
> > > > > >  drivers/net/npcm750_eth.c | 8 ++++----
> > > > > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > > > >
> > > > > > diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> > > > > > index 409d5cce4a..bd29a10def 100644
> > > > > > --- a/drivers/net/npcm750_eth.c
> > > > > > +++ b/drivers/net/npcm750_eth.c
> > > > > > @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
> > > > > >
> > > > > >         pdata->phy_interface = -1;
> > > > > >         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> > > > > > +
> > > > > >         if (phy_mode)
> > > > > > -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> > > > > > -       if (pdata->phy_interface == -1) {
> > > > > > -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> > > > > > +               pdata->phy_interface = dev_read_phy_mode(dev);
> > > > > > +
> > > > > > +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
> > > > > >                 return -EINVAL;
> > > > > > -       }
> > > > > >
> > > > > >         pdata->max_speed = 0;
> > > > > >         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> > > > > > --
> > > > > > 2.17.1
> > > > > >
> > > > > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> >
> > --
> > Tom
Jim Liu Dec. 13, 2022, 3:13 a.m. UTC | #7
Hi Tom

OK , thanks for your reply.

Best regards,
Jim

On Tue, Dec 13, 2022 at 11:01 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Tue, Dec 13, 2022 at 10:56:49AM +0800, Jim Liu wrote:
> > Hi Tom
> >
> > Thanks for your quick response.
> >
> > I add defconfig patch and found this build error and i2c naming issue.
> > https://patchwork.ozlabs.org/project/uboot/patch/20220712092407.16567-2-JJLIU0@nuvoton.com/
> >
> > So I add patch to fix this build error.
> > -> https://patchwork.ozlabs.org/project/uboot/patch/20220913062521.6067-1-JJLIU0@nuvoton.com/
> > -> https://patchwork.ozlabs.org/project/uboot/patch/20221121085932.29686-1-JJLIU0@nuvoton.com/
> >
> > i2c patch is already merged.
>
> OK, I'll put it in my list of things to not forget for the next release
> as well.
>
> >
> > Best regards,
> > Jim
> >
> > On Tue, Dec 13, 2022 at 10:02 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Tue, Dec 13, 2022 at 09:48:12AM +0800, Jim Liu wrote:
> > > > Hi Tom
> > > >
> > > > My upstream topic status is Awaiting Upstream.
> > > > What could I do to make it merge fast?
> > > > Your comments are welcome.
> > >
> > > It's in -next now, for v2023.04.  Does this fix some regression already
> > > present in-tree?
> > >
> > > >
> > > > Best regards,
> > > > Jim
> > > >
> > > > On Mon, Nov 21, 2022 at 3:41 PM Jim Liu <jim.t90615@gmail.com> wrote:
> > > > >
> > > > > Hi  Ramon
> > > > >
> > > > > My upstream topic status is Awaiting Upstream.
> > > > > What could I do to make it merge fast?
> > > > >
> > > > > Best regards,
> > > > > Jim
> > > > >
> > > > > On Sun, Sep 18, 2022 at 2:07 PM Ramon Fried <rfried.dev@gmail.com> wrote:
> > > > > >
> > > > > > On Tue, Sep 13, 2022 at 9:25 AM Jim Liu <jim.t90615@gmail.com> wrote:
> > > > > > >
> > > > > > > The original patch is use phy_get_interface_by_name to set interface.
> > > > > > > The new patch is use dev_read_phy_mode to replace it.
> > > > > > >
> > > > > > > Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> > > > > > > ---
> > > > > > >  drivers/net/npcm750_eth.c | 8 ++++----
> > > > > > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > > > > >
> > > > > > > diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
> > > > > > > index 409d5cce4a..bd29a10def 100644
> > > > > > > --- a/drivers/net/npcm750_eth.c
> > > > > > > +++ b/drivers/net/npcm750_eth.c
> > > > > > > @@ -710,12 +710,12 @@ static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
> > > > > > >
> > > > > > >         pdata->phy_interface = -1;
> > > > > > >         phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
> > > > > > > +
> > > > > > >         if (phy_mode)
> > > > > > > -               pdata->phy_interface = phy_get_interface_by_name(phy_mode);
> > > > > > > -       if (pdata->phy_interface == -1) {
> > > > > > > -               printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
> > > > > > > +               pdata->phy_interface = dev_read_phy_mode(dev);
> > > > > > > +
> > > > > > > +       if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
> > > > > > >                 return -EINVAL;
> > > > > > > -       }
> > > > > > >
> > > > > > >         pdata->max_speed = 0;
> > > > > > >         cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
> > > > > > > --
> > > > > > > 2.17.1
> > > > > > >
> > > > > > Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> > >
> > > --
> > > Tom
>
> --
> Tom
Tom Rini Dec. 23, 2022, 3 p.m. UTC | #8
On Tue, Sep 13, 2022 at 02:25:21PM +0800, Jim Liu wrote:

> The original patch is use phy_get_interface_by_name to set interface.
> The new patch is use dev_read_phy_mode to replace it.
> 
> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/net/npcm750_eth.c b/drivers/net/npcm750_eth.c
index 409d5cce4a..bd29a10def 100644
--- a/drivers/net/npcm750_eth.c
+++ b/drivers/net/npcm750_eth.c
@@ -710,12 +710,12 @@  static int npcm750_eth_ofdata_to_platdata(struct udevice *dev)
 
 	pdata->phy_interface = -1;
 	phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", NULL);
+
 	if (phy_mode)
-		pdata->phy_interface = phy_get_interface_by_name(phy_mode);
-	if (pdata->phy_interface == -1) {
-		printf("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
+		pdata->phy_interface = dev_read_phy_mode(dev);
+
+	if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
 		return -EINVAL;
-	}
 
 	pdata->max_speed = 0;
 	cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);