Commit afa64a72 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by David S. Miller

of: net: kill of_get_nvmem_mac_address()

We've switched all users to nvmem_get_mac_address(). Remove the now
dead code.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cce41b8f
...@@ -81,42 +81,3 @@ const void *of_get_mac_address(struct device_node *np) ...@@ -81,42 +81,3 @@ const void *of_get_mac_address(struct device_node *np)
return of_get_mac_addr(np, "address"); return of_get_mac_addr(np, "address");
} }
EXPORT_SYMBOL(of_get_mac_address); EXPORT_SYMBOL(of_get_mac_address);
/**
* Obtain the MAC address from an nvmem provider named 'mac-address' through
* device tree.
* On success, copies the new address into memory pointed to by addr and
* returns 0. Returns a negative error code otherwise.
* @np: Device tree node containing the nvmem-cells phandle
* @addr: Pointer to receive the MAC address using ether_addr_copy()
*/
int of_get_nvmem_mac_address(struct device_node *np, void *addr)
{
struct nvmem_cell *cell;
const void *mac;
size_t len;
int ret;
cell = of_nvmem_cell_get(np, "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)) {
ret = -EINVAL;
} else {
ether_addr_copy(addr, mac);
ret = 0;
}
kfree(mac);
return ret;
}
EXPORT_SYMBOL(of_get_nvmem_mac_address);
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
struct net_device; struct net_device;
extern int of_get_phy_mode(struct device_node *np); extern int of_get_phy_mode(struct device_node *np);
extern const void *of_get_mac_address(struct device_node *np); extern const void *of_get_mac_address(struct device_node *np);
extern int of_get_nvmem_mac_address(struct device_node *np, void *addr);
extern struct net_device *of_find_net_device_by_node(struct device_node *np); extern struct net_device *of_find_net_device_by_node(struct device_node *np);
#else #else
static inline int of_get_phy_mode(struct device_node *np) static inline int of_get_phy_mode(struct device_node *np)
...@@ -26,11 +25,6 @@ static inline const void *of_get_mac_address(struct device_node *np) ...@@ -26,11 +25,6 @@ static inline const void *of_get_mac_address(struct device_node *np)
return NULL; return NULL;
} }
static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr)
{
return -ENODEV;
}
static inline struct net_device *of_find_net_device_by_node(struct device_node *np) static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
{ {
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment