diff --git a/src/sys/sys/device.c b/src/sys/sys/device.c index 713238f..2cb5254 100644 --- a/src/sys/sys/device.c +++ b/src/sys/sys/device.c @@ -75,9 +75,46 @@ return(0x0); } + +/******************************************************************************************** + +Function: int deviceRemove(struct *deviceNode); + +Description: This will remove a device based on it's pointer + +*********************************************************************************************/ +int deviceRemove(struct deviceNode *deviceToDelete) +{ +struct deviceNode *current, *previous; +current = devices; + while(current != NULL) + { + if(current==deviceToDelete) break; + else + { + previous = current; + current = current->next; + } + } + if(current == NULL) return 1; + else + { + if(current == devices) devices = devices->next; + else previous->next = current->next; + free(current); + return 1; + } + +return 0x0; +} + + /*** $Log$ + Revision 1.6 2004/05/19 15:31:28 reddawg + Fixed up the rest of the references + Revision 1.5 2004/05/19 15:06:48 reddawg Fixing Device Driver System Changed Interface