Skip to content

Commit a06abdc

Browse files
committed
Use ether_getaddr().
1 parent 07ea406 commit a06abdc

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

sys/dev/cadence/if_cemac.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: if_cemac.c,v 1.45 2024/10/15 00:58:15 lloyd Exp $ */
1+
/* $NetBSD: if_cemac.c,v 1.46 2025/10/12 23:30:13 thorpej Exp $ */
22

33
/*
44
* Copyright (c) 2015 Genetec Corporation. All rights reserved.
@@ -48,7 +48,7 @@
4848

4949

5050
#include <sys/cdefs.h>
51-
__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.45 2024/10/15 00:58:15 lloyd Exp $");
51+
__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.46 2025/10/12 23:30:13 thorpej Exp $");
5252

5353
#include <sys/param.h>
5454
#include <sys/types.h>
@@ -185,15 +185,7 @@ cemac_attach_common(struct cemac_softc *sc)
185185
CEMAC_WRITE(ETH_RSR, (u & (ETH_RSR_OVR | ETH_RSR_REC | ETH_RSR_BNA)));
186186

187187
/* Fetch the Ethernet address from property if set. */
188-
prop_dictionary_t prop = device_properties(sc->sc_dev);
189-
prop_data_t enaddr = prop_dictionary_get(prop, "mac-address");
190-
191-
if (enaddr != NULL) {
192-
KASSERT(prop_object_type(enaddr) == PROP_TYPE_DATA);
193-
KASSERT(prop_data_size(enaddr) == ETHER_ADDR_LEN);
194-
memcpy(sc->sc_enaddr, prop_data_value(enaddr),
195-
ETHER_ADDR_LEN);
196-
} else {
188+
if (! ether_getaddr(sc->sc_dev, sc->sc_enaddr)) {
197189
static const uint8_t hardcoded[ETHER_ADDR_LEN] = {
198190
0x00, 0x0d, 0x10, 0x81, 0x0c, 0x94
199191
};

0 commit comments

Comments
 (0)