/* Called by the usb core when the device is removed from the system.  */
static void adu_disconnect(struct usb_interface *interface)
/* Called by the usb core when the device is removed from the system.  */
static void adu_disconnect(struct usb_interface *interface)
{
	struct adu_device *dev;
	int minor;
	dbg(2," %s : enter", __func__);
	dev = usb_get_intfdata(interface);
	mutex_lock(&dev->mtx);
	dev->udev = NULL;
	minor = dev->minor;
	usb_deregister_dev(interface, &adu_class);
	mutex_unlock(&dev->mtx);
	mutex_lock(&adutux_mutex);
	usb_set_intfdata(interface, NULL);
	dbg(2," %s : open count %d", __func__, dev->open_count);
	if (!dev->open_count)
		adu_delete(dev);
	mutex_unlock(&adutux_mutex);
	dev_info(&interface->dev, "ADU device adutux%d now disconnected\n",
		 (minor - ADU_MINOR_BASE));
	dbg(2," %s : leave", __func__);
}