101-net-gianfar-use-mtd-mac-address.patch 619 B

12345678910111213141516171819
  1. --- a/drivers/net/ethernet/freescale/gianfar.c
  2. +++ b/drivers/net/ethernet/freescale/gianfar.c
  3. @@ -858,10 +858,13 @@ static int gfar_of_init(struct platform_
  4. if (stash_len || stash_idx)
  5. priv->device_flags |= FSL_GIANFAR_DEV_HAS_BUF_STASHING;
  6. - mac_addr = of_get_mac_address(np);
  7. + err = of_get_mac_address_mtd(np, dev->dev_addr);
  8. + if (err) {
  9. + mac_addr = of_get_mac_address(np);
  10. - if (mac_addr)
  11. - memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
  12. + if (mac_addr)
  13. + memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
  14. + }
  15. if (model && !strcasecmp(model, "TSEC"))
  16. priv->device_flags |= FSL_GIANFAR_DEV_HAS_GIGABIT |