mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/saul_reg: remove deprecated saul_reg_rm
This commit is contained in:
parent
c5656ef3b2
commit
08f93d7904
@ -69,26 +69,6 @@ extern saul_reg_t *saul_reg;
|
||||
*/
|
||||
int saul_reg_add(saul_reg_t *dev);
|
||||
|
||||
/**
|
||||
* @brief Unregister a device from the SAUL registry
|
||||
*
|
||||
* @warning Removing the device at runtime can send applications that have
|
||||
* looked up that device into invalid states, and should thus be
|
||||
* avoided.
|
||||
*
|
||||
* @warning This function must only be used by drivers that advise developers
|
||||
* using them on how to prevent race conditions when using SAUL.
|
||||
*
|
||||
* @deprecated This function will be removed soon as it is practically unusable
|
||||
* for the above reasons.
|
||||
*
|
||||
* @param[in] dev pointer to a registry entry
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return -ENODEV if device was not found in the registry
|
||||
*/
|
||||
int saul_reg_rm(saul_reg_t *dev);
|
||||
|
||||
/**
|
||||
* @brief Find a device by its position in the registry
|
||||
*
|
||||
|
@ -53,29 +53,6 @@ int saul_reg_add(saul_reg_t *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int saul_reg_rm(saul_reg_t *dev)
|
||||
{
|
||||
saul_reg_t *tmp = saul_reg;
|
||||
|
||||
if (saul_reg == NULL || dev == NULL) {
|
||||
return -ENODEV;
|
||||
}
|
||||
if (saul_reg == dev) {
|
||||
saul_reg = dev->next;
|
||||
return 0;
|
||||
}
|
||||
while (tmp->next && (tmp->next != dev)) {
|
||||
tmp = tmp->next;
|
||||
}
|
||||
if (tmp->next == dev) {
|
||||
tmp->next = dev->next;
|
||||
}
|
||||
else {
|
||||
return -ENODEV;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
saul_reg_t *saul_reg_find_nth(int pos)
|
||||
{
|
||||
saul_reg_t *tmp = saul_reg;
|
||||
|
Loading…
Reference in New Issue
Block a user