782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch 748 B

1234567891011121314151617181920212223242526272829
  1. --- a/backport-include/linux/of_net.h
  2. +++ /dev/null
  3. @@ -1,26 +0,0 @@
  4. -#ifndef _BP_OF_NET_H
  5. -#define _BP_OF_NET_H
  6. -#include_next <linux/of_net.h>
  7. -#include <linux/version.h>
  8. -#include <linux/etherdevice.h>
  9. -
  10. -/* The behavior of of_get_mac_address() changed in kernel 5.2, it now
  11. - * returns an error code and not NULL in case of an error.
  12. - */
  13. -#if LINUX_VERSION_IS_LESS(5,13,0)
  14. -static inline int backport_of_get_mac_address(struct device_node *np, u8 *mac_out)
  15. -{
  16. - const void *mac = of_get_mac_address(np);
  17. -
  18. - if (!mac)
  19. - return -ENODEV;
  20. - if (IS_ERR(mac))
  21. - return PTR_ERR(mac);
  22. - ether_addr_copy(mac_out, mac);
  23. -
  24. - return 0;
  25. -}
  26. -#define of_get_mac_address LINUX_BACKPORT(of_get_mac_address)
  27. -#endif /* < 5.2 */
  28. -
  29. -#endif /* _BP_OF_NET_H */