diff mbox series

[net-next,2/2] ethernet: remove nvmem_get_mac_address()

Message ID 20211013082622.707-1-yajun.deng@linux.dev (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/2] of: net: move nvmem_get_mac_address() into of_get_mac_addr_nvmem() | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 6 maintainers not CCed: michael@walle.cc ktkhai@virtuozzo.com mchehab+huawei@kernel.org andrew@lunn.ch alobakin@pm.me vladimir.oltean@nxp.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 4337 this patch: 4337
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 49 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 4420 this patch: 4420
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Yajun Deng Oct. 13, 2021, 8:26 a.m. UTC
nvmem_get_mac_address() is no longer used, remove it.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 include/linux/etherdevice.h |  1 -
 net/ethernet/eth.c          | 36 ------------------------------------
 2 files changed, 37 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 3cf546d2ffd1..9a8f46afe114 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -31,7 +31,6 @@  struct fwnode_handle;
 int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr);
 int platform_get_ethdev_address(struct device *dev, struct net_device *netdev);
 unsigned char *arch_get_platform_mac_address(void);
-int nvmem_get_mac_address(struct device *dev, void *addrbuf);
 int device_get_mac_address(struct device *dev, char *addr);
 int device_get_ethdev_address(struct device *dev, struct net_device *netdev);
 int fwnode_get_mac_address(struct fwnode_handle *fwnode, char *addr);
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index c7d9e08107cb..210ff7235e5f 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -543,42 +543,6 @@  int platform_get_ethdev_address(struct device *dev, struct net_device *netdev)
 }
 EXPORT_SYMBOL(platform_get_ethdev_address);
 
-/**
- * nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named
- * 'mac-address' associated with given device.
- *
- * @dev:	Device with which the mac-address cell is associated.
- * @addrbuf:	Buffer to which the MAC address will be copied on success.
- *
- * Returns 0 on success or a negative error number on failure.
- */
-int nvmem_get_mac_address(struct device *dev, void *addrbuf)
-{
-	struct nvmem_cell *cell;
-	const void *mac;
-	size_t len;
-
-	cell = nvmem_cell_get(dev, "mac-address");
-	if (IS_ERR(cell))
-		return PTR_ERR(cell);
-
-	mac = nvmem_cell_read(cell, &len);
-	nvmem_cell_put(cell);
-
-	if (IS_ERR(mac))
-		return PTR_ERR(mac);
-
-	if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
-		kfree(mac);
-		return -EINVAL;
-	}
-
-	ether_addr_copy(addrbuf, mac);
-	kfree(mac);
-
-	return 0;
-}
-
 static int fwnode_get_mac_addr(struct fwnode_handle *fwnode,
 			       const char *name, char *addr)
 {