Skip to content

Commit cdc7514

Browse files
refactor(driver): remove unneeded dup platform code
Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
1 parent 4e90d73 commit cdc7514

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

driver/driver.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@ static const struct euicc_driver *find_driver_by_path(const char *restrict dir,
295295
return driver;
296296
}
297297

298-
#if defined(__unix__) || defined(__unix)
299298
static bool init_driver_list() {
300299
if (list_empty(&drivers)) {
301300
return true;
302301
}
302+
303303
_cleanup_free_ char *LPAC_DRIVER_HOME = get_driver_path();
304304
if (LPAC_DRIVER_HOME == NULL)
305305
return false;
@@ -332,22 +332,6 @@ static bool init_driver_list() {
332332
}
333333
return true;
334334
}
335-
#else
336-
static bool init_driver_list() {
337-
if (list_empty(&drivers)) {
338-
return true;
339-
}
340-
for (int i = 0; builtin_drivers[i] != NULL; i++) {
341-
struct euicc_drivers_list *tmp = (struct euicc_drivers_list *)calloc(1, sizeof(struct euicc_drivers_list));
342-
if (tmp == NULL) {
343-
return false;
344-
}
345-
tmp->driver = builtin_drivers[i];
346-
list_add_tail(&tmp->list, &drivers);
347-
}
348-
return true;
349-
}
350-
#endif
351335

352336
static const struct euicc_driver *find_driver_by_name(const enum euicc_driver_type type, const char *name) {
353337
char *driver_type = NULL;

0 commit comments

Comments
 (0)