Skip to content

Commit 473d9ba

Browse files
brglclaudiubeznea
authored andcommitted
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: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c8532d7 commit 473d9ba

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

drivers/of/of_net.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -128,42 +128,3 @@ const void *of_get_mac_address(struct device_node *np)
128128
return of_get_mac_addr_nvmem(np);
129129
}
130130
EXPORT_SYMBOL(of_get_mac_address);
131-
132-
/**
133-
* Obtain the MAC address from an nvmem provider named 'mac-address' through
134-
* device tree.
135-
* On success, copies the new address into memory pointed to by addr and
136-
* returns 0. Returns a negative error code otherwise.
137-
* @np: Device tree node containing the nvmem-cells phandle
138-
* @addr: Pointer to receive the MAC address using ether_addr_copy()
139-
*/
140-
int of_get_nvmem_mac_address(struct device_node *np, void *addr)
141-
{
142-
struct nvmem_cell *cell;
143-
const void *mac;
144-
size_t len;
145-
int ret;
146-
147-
cell = of_nvmem_cell_get(np, "mac-address");
148-
if (IS_ERR(cell))
149-
return PTR_ERR(cell);
150-
151-
mac = nvmem_cell_read(cell, &len);
152-
153-
nvmem_cell_put(cell);
154-
155-
if (IS_ERR(mac))
156-
return PTR_ERR(mac);
157-
158-
if (len < ETH_ALEN || !is_valid_ether_addr(mac)) {
159-
ret = -EINVAL;
160-
} else {
161-
ether_addr_copy(addr, mac);
162-
ret = 0;
163-
}
164-
165-
kfree(mac);
166-
167-
return ret;
168-
}
169-
EXPORT_SYMBOL(of_get_nvmem_mac_address);

include/linux/of_net.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
struct net_device;
1414
extern int of_get_phy_mode(struct device_node *np);
1515
extern const void *of_get_mac_address(struct device_node *np);
16-
extern int of_get_nvmem_mac_address(struct device_node *np, void *addr);
1716
extern struct net_device *of_find_net_device_by_node(struct device_node *np);
1817
#else
1918
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)
2625
return NULL;
2726
}
2827

29-
static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr)
30-
{
31-
return -ENODEV;
32-
}
33-
3428
static inline struct net_device *of_find_net_device_by_node(struct device_node *np)
3529
{
3630
return NULL;

0 commit comments

Comments
 (0)