summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_rl.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-09-15 10:40:54 +0000
committerglebius <glebius@FreeBSD.org>2006-09-15 10:40:54 +0000
commitaeb9aeaa73fe735ddc4a606776072563dd9b6b43 (patch)
treeae382d23f768d8bc206d445054d2cee99c94d544 /sys/pci/if_rl.c
parent6b78b3a81dfd58cd5838b6fae2c4f76e95a5f930 (diff)
downloadFreeBSD-src-aeb9aeaa73fe735ddc4a606776072563dd9b6b43.zip
FreeBSD-src-aeb9aeaa73fe735ddc4a606776072563dd9b6b43.tar.gz
Consistently use if_printf() only in interface methods: if_start,
if_ioctl, if_watchdog, etc, or in functions that are used by these methods only. In all other cases use device_printf(). This also fixes several panics, when if_printf() is called before softc->ifp was initialized. Submitted by: Alex Lyashkov <umka sevcity.net>
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r--sys/pci/if_rl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 0fae3dd..87189a8 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -578,7 +578,7 @@ rl_miibus_readreg(device_t dev, int phy, int reg)
rval = CSR_READ_1(sc, RL_MEDIASTAT);
return (rval);
default:
- if_printf(sc->rl_ifp, "bad phy register\n");
+ device_printf(sc->rl_dev, "bad phy register\n");
return (0);
}
rval = CSR_READ_2(sc, rl8139_reg);
@@ -628,7 +628,7 @@ rl_miibus_writereg(device_t dev, int phy, int reg, int data)
return (0);
break;
default:
- if_printf(sc->rl_ifp, "bad phy register\n");
+ device_printf(sc->rl_dev, "bad phy register\n");
return (0);
}
CSR_WRITE_2(sc, rl8139_reg, data);
@@ -718,7 +718,7 @@ rl_reset(struct rl_softc *sc)
break;
}
if (i == RL_TIMEOUT)
- if_printf(sc->rl_ifp, "reset never completed!\n");
+ device_printf(sc->rl_dev, "reset never completed!\n");
}
/*
@@ -793,6 +793,7 @@ rl_attach(device_t dev)
sc = device_get_softc(dev);
unit = device_get_unit(dev);
+ sc->rl_dev = dev;
mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF);
@@ -974,7 +975,7 @@ rl_attach(device_t dev)
error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE,
rl_intr, sc, &sc->rl_intrhand);
if (error) {
- if_printf(ifp, "couldn't set up irq\n");
+ device_printf(sc->rl_dev, "couldn't set up irq\n");
ether_ifdetach(ifp);
}
OpenPOWER on IntegriCloud