> +static void usb_host_cleanup(struct Notifier* n) > +{ > + struct USBHostDevice *s; > + > + QTAILQ_FOREACH(s,&hostdevs, next) { > + if (s->fd != -1) { > + ioctl(s->fd, USBDEVFS_RESET); > + } > + } > +} Well. The point of exit notifiers is that you don't need global variables for your cleanup work because the notifier function gets passed in a handle to your state data. In that specific case the global hostdevs is needed anyway for other reasons. Nevertheless I don't want usb-linux.c set a bad example, but provide a good reference implementation for others to look at. Patch attached (untested). cheers, Gerd