Skip to content

Commit

Permalink
qca-nss-gmac: fixes nvmem patches
Browse files Browse the repository at this point in the history
  • Loading branch information
aiamadeus committed Apr 1, 2022
1 parent f5a6612 commit 3186d2e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
6 changes: 3 additions & 3 deletions package/qca/nss/qca-nss-gmac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=qca-nss-gmac
PKG_RELEASE:=3
PKG_RELEASE:=1

PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-gmac
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-gmac
PKG_SOURCE_VERSION:=9b74deef2816d91e58926e6fab7a6ff931eb3b22
PKG_MIRROR_HASH:=a1939caa638414323e60f7d29f797ea831c6036e424b8e7bd6cf2d3d874de064

Expand All @@ -15,7 +15,7 @@ define KernelPackage/qca-nss-gmac
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x @LINUX_5_4
DEPENDS:=@TARGET_ipq806x @LINUX_5_4
TITLE:=Kernel driver for NSS gmac
FILES:=$(PKG_BUILD_DIR)/ipq806x/qca-nss-gmac.ko
AUTOLOAD:=$(call AutoLoad,31,qca-nss-gmac)
Expand Down
22 changes: 18 additions & 4 deletions package/qca/nss/qca-nss-gmac/patches/101-nss-gmac-test-ptr.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
--- a/ipq806x/nss_gmac_ctrl.c
+++ b/ipq806x/nss_gmac_ctrl.c
@@ -992,7 +992,7 @@ static int32_t nss_gmac_of_get_pdata(str
@@ -957,7 +957,8 @@ static int32_t nss_gmac_of_get_pdata(struct device_node *np,
struct net_device *netdev,
struct msm_nss_gmac_platform_data *gmaccfg)
{
- uint8_t *maddr = NULL;
+ int ret;
+ u8 maddr[ETH_ALEN];
struct nss_gmac_dev *gmacdev = (struct nss_gmac_dev *)netdev_priv(netdev);
struct resource memres_devtree = {0};

@@ -991,9 +992,9 @@ static int32_t nss_gmac_of_get_pdata(struct device_node *np,
pr_err("%s: Can't map interrupt\n", np->name);
return -EFAULT;
}
maddr = (uint8_t *)of_get_mac_address(np);
- maddr = (uint8_t *)of_get_mac_address(np);
- if (maddr)
+ if (!IS_ERR_OR_NULL(maddr))
memcpy(gmaccfg->mac_addr, maddr, ETH_ALEN);
- memcpy(gmaccfg->mac_addr, maddr, ETH_ALEN);
+ ret = of_get_mac_address(np, maddr);
+ if (!ret && is_valid_ether_addr(maddr))
+ ether_addr_copy(gmaccfg->mac_addr, maddr);

if (of_address_to_resource(np, 0, &memres_devtree) != 0)
return -EFAULT;
23 changes: 0 additions & 23 deletions package/qca/nss/qca-nss-gmac/patches/102-nss-gmac-nvmem.patch

This file was deleted.

0 comments on commit 3186d2e

Please sign in to comment.