diff mbox

[U-Boot,v2,1/2] fdt: Deprecate "usbethaddr" usage in fdt_fixup_ethernet()

Message ID 1446451095-18495-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 52d825cc7b9d50f286cdbd026733bb15e81d3c66
Delegated to: Joe Hershberger
Headers show

Commit Message

Bin Meng Nov. 2, 2015, 7:58 a.m. UTC
In fdt_fixup_ethernet() only "usbethaddr" is handled to fix up the
first usb ethernet port MAC address. Other additional usb ethernet
ports are ignored as there is no logic to handle "usbeth%daddr".

It is suggested we should use "ethaddr" for all ethernet devices.
Hence deprecate "usbethaddr" usage in fdt_fixup_ethernet(). Note
this actually reverts commit b1f49ab.

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

---

Changes in v2:
- New patch to deprecate "usbethaddr" usage in fdt_fixup_ethernet()

 common/fdt_support.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

Joe Hershberger Nov. 2, 2015, 8:54 p.m. UTC | #1
Hi Bin,

On Mon, Nov 2, 2015 at 1:58 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
> In fdt_fixup_ethernet() only "usbethaddr" is handled to fix up the
> first usb ethernet port MAC address. Other additional usb ethernet
> ports are ignored as there is no logic to handle "usbeth%daddr".
>
> It is suggested we should use "ethaddr" for all ethernet devices.
> Hence deprecate "usbethaddr" usage in fdt_fixup_ethernet(). Note
> this actually reverts commit b1f49ab.

Please include the subject of this commit that is reverted. Also a
good idea to include the entire commit ID.

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

Other than that,
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

> ---
>
> Changes in v2:
> - New patch to deprecate "usbethaddr" usage in fdt_fixup_ethernet()
>
>  common/fdt_support.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index a7ff2df..ec72b86 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -490,18 +490,8 @@ void fdt_fixup_ethernet(void *fdt)
>         if (node < 0)
>                 return;
>
> -       if (!getenv("ethaddr")) {
> -               if (getenv("usbethaddr")) {
> -                       strcpy(mac, "usbethaddr");
> -               } else {
> -                       debug("No ethernet MAC Address defined\n");
> -                       return;
> -               }
> -       } else {
> -               strcpy(mac, "ethaddr");
> -       }
> -
>         i = 0;
> +       strcpy(mac, "ethaddr");
>         while ((tmp = getenv(mac)) != NULL) {
>                 sprintf(enet, "ethernet%d", i);
>                 path = fdt_getprop(fdt, node, enet, NULL);
> --
> 1.8.2.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Tom Rini Nov. 2, 2015, 11:24 p.m. UTC | #2
On Sun, Nov 01, 2015 at 11:58:14PM -0800, Bin Meng wrote:

> In fdt_fixup_ethernet() only "usbethaddr" is handled to fix up the
> first usb ethernet port MAC address. Other additional usb ethernet
> ports are ignored as there is no logic to handle "usbeth%daddr".
> 
> It is suggested we should use "ethaddr" for all ethernet devices.
> Hence deprecate "usbethaddr" usage in fdt_fixup_ethernet(). Note
> this actually reverts commit b1f49ab.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> 

Reviewed-by: Tom Rini <trini@konsulko.com>
On OMAP4 Panda (+ v4.3 kernel)
Tested-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/common/fdt_support.c b/common/fdt_support.c
index a7ff2df..ec72b86 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -490,18 +490,8 @@  void fdt_fixup_ethernet(void *fdt)
 	if (node < 0)
 		return;
 
-	if (!getenv("ethaddr")) {
-		if (getenv("usbethaddr")) {
-			strcpy(mac, "usbethaddr");
-		} else {
-			debug("No ethernet MAC Address defined\n");
-			return;
-		}
-	} else {
-		strcpy(mac, "ethaddr");
-	}
-
 	i = 0;
+	strcpy(mac, "ethaddr");
 	while ((tmp = getenv(mac)) != NULL) {
 		sprintf(enet, "ethernet%d", i);
 		path = fdt_getprop(fdt, node, enet, NULL);