General changes from the obattler_202406 branch

Co-Authored-By: Miran Grča <oubattler@gmail.com>
This commit is contained in:
Jasmine Iwanek
2024-09-09 00:43:14 -04:00
parent 9d1b9b7d02
commit d00f80d3ce
57 changed files with 493 additions and 468 deletions

View File

@@ -158,6 +158,13 @@ device_add_common(const device_t *dev, void *p, void *params, int inst)
void *priv = NULL;
int16_t c;
/*
IMPORTANT: This is needed to gracefully handle machine
device addition if the relevant device is NULL.
*/
if (dev == NULL)
return NULL;
if (!device_available(dev)) {
wchar_t temp[512] = { 0 };
swprintf(temp, sizeof_w(temp),