Warn on duplicate master releasing.

This commit is contained in:
Florian Pose 2007-01-12 12:10:09 +00:00
parent cde396cdc2
commit d5cd924844
1 changed files with 7 additions and 1 deletions

View File

@ -471,13 +471,19 @@ ec_master_t *ecrt_request_master(unsigned int master_index
void ecrt_release_master(ec_master_t *master /**< EtherCAT master */)
{
EC_INFO("Releasing master %i...\n", master->index);
if (master->mode != EC_MASTER_MODE_OPERATION) {
EC_WARN("Master %i was was not requested!\n", master->index);
return;
}
ec_master_leave_operation_mode(master);
module_put(master->device->module);
atomic_inc(&master->available);
EC_INFO("Released master %i.\n", master->index);
return;
}
/*****************************************************************************/