The convenience function ds__destroy() is used for destroying objects. Devices are rarely destroyed in a device server. This is mainly because the device server's main task is to serve all devices as long as it exists. In the event that a device has to be destroyed however the DevMethodDestroy is called. ds__destroy() uses the ds__method_finder() for finding and executing DevMethodDestroy. The DevServerClass has DevMethodDestroy implemented - its main role is to deallocate the space occupied by the device structure.
The device destroy function has following syntax -
long ds__destroy (void *ptr_ds_class, void *ptr_ds, long *error)