summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_pf.c
diff options
context:
space:
mode:
authorweongyo <weongyo@FreeBSD.org>2010-11-25 03:30:43 +0000
committerweongyo <weongyo@FreeBSD.org>2010-11-25 03:30:43 +0000
commitcfdc99ec6ccd5e35d343f13054cc0bc5f6d04797 (patch)
tree59d42af7022916d307450d5989d11b26b7260213 /sys/dev/usb/usb_pf.c
parent0e804ca5ee4d874b58c1a27649258da21b2a2057 (diff)
downloadFreeBSD-src-cfdc99ec6ccd5e35d343f13054cc0bc5f6d04797.zip
FreeBSD-src-cfdc99ec6ccd5e35d343f13054cc0bc5f6d04797.tar.gz
Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load / unloaded repeatly. Attaching the USB pf is moved to usbus device's attach. Pointed by: yongari
Diffstat (limited to 'sys/dev/usb/usb_pf.c')
-rw-r--r--sys/dev/usb/usb_pf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c
index 16cf8d7..c2925c2 100644
--- a/sys/dev/usb/usb_pf.c
+++ b/sys/dev/usb/usb_pf.c
@@ -61,10 +61,9 @@ void
usbpf_attach(struct usb_bus *ubus)
{
struct ifnet *ifp;
- devclass_t dc = devclass_find("usbus");
ifp = ubus->ifp = if_alloc(IFT_USB);
- if_initname(ifp, "usbus", devclass_get_count(dc));
+ if_initname(ifp, "usbus", device_get_unit(ubus->bdev));
if_attach(ifp);
KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
OpenPOWER on IntegriCloud