Bugfix: Freerun mode not stopped cleanly on device unloading.
--- a/master/master.c Mon Jun 12 15:14:12 2006 +0000
+++ b/master/master.c Wed Jun 14 10:23:02 2006 +0000
@@ -704,13 +704,13 @@
ec_master_eoe_stop(master);
EC_INFO("Stopping Free-Run mode.\n");
+ master->mode = EC_MASTER_MODE_IDLE;
if (!cancel_delayed_work(&master->freerun_work)) {
flush_workqueue(master->workqueue);
}
ec_master_clear_slaves(master);
- master->mode = EC_MASTER_MODE_IDLE;
}
/*****************************************************************************/
@@ -736,7 +736,8 @@
// release master lock
spin_unlock_bh(&master->internal_lock);
- queue_delayed_work(master->workqueue, &master->freerun_work, 1);
+ if (master->mode == EC_MASTER_MODE_FREERUN)
+ queue_delayed_work(master->workqueue, &master->freerun_work, 1);
}
/*****************************************************************************/