mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
ipq807x: backport support for nvmem
This commit is contained in:
parent
bcbc73b584
commit
409997d01c
@ -0,0 +1,42 @@
|
|||||||
|
From f3a7b93137c1a6a1b8010b86296242178eed5d9e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Robert Marko <robimarko@gmail.com>
|
||||||
|
Date: Fri, 13 Aug 2021 20:03:21 +0200
|
||||||
|
Subject: [PATCH] SSDK: dts: fix of_get_mac_address()
|
||||||
|
|
||||||
|
Recently OpenWrt backported the updated of_get_mac_address()
|
||||||
|
function which returns and error code instead.
|
||||||
|
|
||||||
|
So, patch the SSDK to use it and fix the compilation error.
|
||||||
|
|
||||||
|
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||||
|
---
|
||||||
|
src/init/ssdk_dts.c | 7 ++++---
|
||||||
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/src/init/ssdk_dts.c
|
||||||
|
+++ b/src/init/ssdk_dts.c
|
||||||
|
@@ -779,8 +779,9 @@ static void ssdk_dt_parse_intf_mac(void)
|
||||||
|
{
|
||||||
|
struct device_node *dp_node = NULL;
|
||||||
|
a_uint32_t dp = 0;
|
||||||
|
- a_uint8_t *maddr = NULL;
|
||||||
|
+ u8 maddr[ETH_ALEN];
|
||||||
|
char dp_name[8] = {0};
|
||||||
|
+ int ret;
|
||||||
|
|
||||||
|
for (dp = 1; dp <= SSDK_MAX_NR_ETH; dp++) {
|
||||||
|
snprintf(dp_name, sizeof(dp_name), "dp%d", dp);
|
||||||
|
@@ -788,11 +789,11 @@ static void ssdk_dt_parse_intf_mac(void)
|
||||||
|
if (!dp_node) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
- maddr = (a_uint8_t *)of_get_mac_address(dp_node);
|
||||||
|
+ ret = of_get_mac_address(dp_node, maddr);
|
||||||
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
|
||||||
|
if (maddr && is_valid_ether_addr(maddr)) {
|
||||||
|
#else
|
||||||
|
- if (!IS_ERR(maddr) && is_valid_ether_addr(maddr)) {
|
||||||
|
+ if (!ret && is_valid_ether_addr(maddr)) {
|
||||||
|
#endif
|
||||||
|
ssdk_dt_global.num_intf_mac++;
|
||||||
|
ether_addr_copy(ssdk_dt_global.intf_mac[dp-1].uc, maddr);
|
Loading…
Reference in New Issue
Block a user