All devices registered by a driver are unregistered automatically when the program exits (or crashes). However, the fusd_unregister() function can be used to unregister a device without terminating the entire driver. fusd_unregister takes one argument: a device handle (i.e., the return value from fusd_register()).
A device can be unregistered at any time. Any client system calls that are pending when a device is unregistered will return immediately with an error. In this case, errno will be set to -EPIPE.