config_detach is just used in one place, so expand it inline.

This commit is contained in:
Warner Losh 2007-06-13 20:58:57 +00:00
parent 34a9edafbc
commit 6f93a78c1a
2 changed files with 6 additions and 9 deletions

View File

@ -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...) \

View File

@ -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;
}
}