// Sanity check
if((Uint)Ptr < (Uint)gHeapStart || (Uint)Ptr > (Uint)gHeapEnd)
{
- Log_Warning("Heap", "free - Passed a non-heap address by %p (%p < %p < %p)\n",
+ Log_Warning("Heap", "free - Passed a non-heap address by %p (%p < %p < %p)",
__builtin_return_address(0), gHeapStart, Ptr, gHeapEnd);
return;
}
// Free Parent
mountpt->OpenHandleCount --;
_CloseNode(parent);
-
- // Error Check
- if(ret != 0) {
- LEAVE('i', -1);
- return -1;
- }
-
- LEAVE('i', 0);
- return 0;
+
+ // Return whatever the driver said
+ LEAVE('i', ret);
+ return ret;
}
/**
LOG("Sanity check name length - %i > %i", strlen(Name)+1, sizeof(child->Name));
if(strlen(Name) + 1 > sizeof(child->Name))
- LEAVE_RET('i', 0);
+ LEAVE_RET('i', EINVAL);
// Find last child, while we're at it, check for duplication
for( child = parent->Data.FirstChild; child; prev = child, child = child->Next )
{
if(strcmp(child->Name, Name) == 0) {
LOG("Duplicate");
- LEAVE('i', 0);
- return 0;
+ LEAVE('i', EEXIST);
+ return EEXIST;
}
}
parent->Node.Size ++;
- LEAVE('i', 1);
- return 1;
+ LEAVE('i', EOK);
+ return EOK;
}
/**
info->Info = NULL;
info->CollectionDepth = 1;
info->bIsBoot = 1; // TODO: Detect non-boot keyboards and parse descriptor
- Log_Warning("USB HID", "TODO: Handle non-boot keyboards!");
+ Log_Warning("USB HID", "TODO: Detect and handle non-boot keyboards!");
info->Info = Keyboard_CreateInstance(0, "USBKeyboard");
}
}