summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/net/usb_ethernet.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/net/usb_ethernet.c')
-rw-r--r--sys/dev/usb/net/usb_ethernet.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c
index 6cf4460..427137a 100644
--- a/sys/dev/usb/net/usb_ethernet.c
+++ b/sys/dev/usb/net/usb_ethernet.c
@@ -221,10 +221,10 @@ ue_attach_post_task(struct usb_proc_msg *_task)
if (ue->ue_methods->ue_mii_upd != NULL &&
ue->ue_methods->ue_mii_sts != NULL) {
- mtx_lock(&Giant); /* device_xxx() depends on this */
+ newbus_xlock();
error = mii_phy_probe(ue->ue_dev, &ue->ue_miibus,
ue_ifmedia_upd, ue->ue_methods->ue_mii_sts);
- mtx_unlock(&Giant);
+ newbus_xunlock();
if (error) {
device_printf(ue->ue_dev, "MII without any PHY\n");
goto error;
@@ -279,9 +279,12 @@ uether_ifdetach(struct usb_ether *ue)
/* detach miibus */
if (ue->ue_miibus != NULL) {
- mtx_lock(&Giant); /* device_xxx() depends on this */
+
+ /*
+ * It is up to the callers to provide the correct
+ * newbus locking.
+ */
device_delete_child(ue->ue_dev, ue->ue_miibus);
- mtx_unlock(&Giant);
}
/* detach ethernet */
OpenPOWER on IntegriCloud