- if (sdi->status == SR_ST_ACTIVE) {
- /* Close the memory mapping and the file */
- beaglelogic_munmap(devc);
- beaglelogic_close(devc);
- }
- sdi->status = SR_ST_INACTIVE;
- return SR_OK;
-}
-
-static int cleanup(void)
-{
- struct drv_context *drvc;
- struct sr_dev_inst *sdi;
- GSList *l;
-
- /* unused driver */
- if (!(drvc = di->priv))
- return SR_OK;
-
- /* Clean up the instances */
- for (l = drvc->instances; l; l = l->next) {
- sdi = l->data;
- di->dev_close(sdi);
- g_free(sdi->priv);
- sr_dev_inst_free(sdi);
- }
- g_slist_free(drvc->instances);
- drvc->instances = NULL;
-
- di->priv = NULL;
+ /* Close the memory mapping and the file */
+ beaglelogic_munmap(devc);
+ beaglelogic_close(devc);