summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/usb_port.h8
-rw-r--r--sys/dev/usb/usb_subr.c7
2 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index e9136f4..8269c2c 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -85,14 +85,6 @@ typedef struct callout usb_callout_t;
#define PWR_RESUME 0
#define PWR_SUSPEND 1
-#define config_detach(dev, flag) \
- do { \
- struct usb_attach_arg *uaap = device_get_ivars(dev); \
- device_detach(dev); \
- free(uaap, M_USB); \
- device_delete_child(device_get_parent(dev), dev); \
- } while (0)
-
typedef struct malloc_type *usb_malloc_type;
#define USB_DECLARE_DRIVER_INIT(dname, init...) \
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index fcfb45c..cc561cc 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1363,7 +1363,12 @@ usb_disconnect_port(struct usbd_port *up, device_t parent)
if (up->portno != 0)
printf(" port %d", up->portno);
printf(" (addr %d) disconnected\n", dev->address);
- config_detach(dev->subdevs[i], DETACH_FORCE);
+ struct usb_attach_arg *uaap =
+ device_get_ivars(dev->subdevs[i]);
+ device_detach(dev);
+ free(uaap, M_USB);
+ device_delete_child(device_get_parent(dev->subdevs[i]),
+ dev->subdevs[i]);
dev->subdevs[i] = NULL;
}
}
OpenPOWER on IntegriCloud