aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/net
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-03-21 00:34:28 +0000
committerEd Maste <emaste@FreeBSD.org>2020-03-21 00:34:28 +0000
commit547e7be891d8247983675a3dac0c256363e4fd30 (patch)
tree9f9e31b1f1df08dc9e6b5331e7cc087b0138a865 /sys/dev/usb/net
parent293f97d9581c5c969e0af21910cd6f843ba3dbc4 (diff)
Notes
Diffstat (limited to 'sys/dev/usb/net')
-rw-r--r--sys/dev/usb/net/if_muge.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/usb/net/if_muge.c b/sys/dev/usb/net/if_muge.c
index 1607d986e14b..9eed2505fca3 100644
--- a/sys/dev/usb/net/if_muge.c
+++ b/sys/dev/usb/net/if_muge.c
@@ -389,9 +389,10 @@ lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_t off, uint8_t *buf,
{
usb_ticks_t start_ticks;
const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000);
- int err, locked;
+ int err;
uint32_t val, saved;
uint16_t i;
+ bool locked;
locked = mtx_owned(&sc->sc_mtx); /* XXX */
if (!locked)
@@ -483,9 +484,10 @@ static int
lan78xx_otp_read_raw(struct muge_softc *sc, uint16_t off, uint8_t *buf,
uint16_t buflen)
{
- int locked, err;
+ int err;
uint32_t val;
uint16_t i;
+ bool locked;
locked = mtx_owned(&sc->sc_mtx);
if (!locked)
MUGE_LOCK(sc);
@@ -659,8 +661,8 @@ static int
lan78xx_miibus_readreg(device_t dev, int phy, int reg)
{
struct muge_softc *sc = device_get_softc(dev);
- int locked;
uint32_t addr, val;
+ bool locked;
val = 0;
locked = mtx_owned(&sc->sc_mtx);
@@ -712,8 +714,8 @@ static int
lan78xx_miibus_writereg(device_t dev, int phy, int reg, int val)
{
struct muge_softc *sc = device_get_softc(dev);
- int locked;
uint32_t addr;
+ bool locked;
if (sc->sc_phyno != phy)
return (0);
@@ -760,10 +762,10 @@ lan78xx_miibus_statchg(device_t dev)
struct muge_softc *sc = device_get_softc(dev);
struct mii_data *mii = uether_getmii(&sc->sc_ue);
struct ifnet *ifp;
- int locked;
int err;
uint32_t flow = 0;
uint32_t fct_flow = 0;
+ bool locked;
locked = mtx_owned(&sc->sc_mtx);
if (!locked)