void close ()
    throws USBException
    {
        if (fd < 0)
            return;

        try {
            // make sure this isn't usable any more
            long status = closeNative (fd);
            if (status < 0)
                throw new USBException ("error closing device",
                                       (int)(-status));
        } finally {
            // make sure nobody else sees the device
            usb.removeDev (this);
            hub = null;
            fd = -1;
        }
    }