* load kernel modules
*
* Copyright (C) 2011 Kay Sievers <kay.sievers@vrfy.org>
- * Copyright (C) 2011 ProFUSION embedded systems
+ * Copyright (C) 2011 ProFUSION embedded systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return EXIT_SUCCESS;
}
-static int builtin_kmod_load(struct udev *udev)
+static int builtin_kmod_init(struct udev *udev)
{
kmod_unref(ctx);
ctx = kmod_new(NULL, NULL);
return 0;
}
-static int builtin_kmod_unload(struct udev *udev)
+static int builtin_kmod_exit(struct udev *udev)
{
ctx = kmod_unref(ctx);
info(udev, "unload module index\n");
const struct udev_builtin udev_builtin_kmod = {
.name = "kmod",
.cmd = builtin_kmod,
- .load = builtin_kmod_load,
- .unload = builtin_kmod_unload,
+ .init = builtin_kmod_init,
+ .exit = builtin_kmod_exit,
.help = "kernel module loader",
.run_once = false,
};
[UDEV_BUILTIN_KMOD] = &udev_builtin_kmod,
};
-int udev_builtin_load(struct udev *udev)
+int udev_builtin_init(struct udev *udev)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(builtins); i++)
- if (builtins[i]->load)
- builtins[i]->load(udev);
+ if (builtins[i]->init)
+ builtins[i]->init(udev);
return 0;
}
-int udev_builtin_unload(struct udev *udev)
+int udev_builtin_exit(struct udev *udev)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(builtins); i++)
- if (builtins[i]->unload)
- builtins[i]->unload(udev);
+ if (builtins[i]->exit)
+ builtins[i]->exit(udev);
return 0;
}
const char *name;
int (*cmd)(struct udev_device *dev, int argc, char *argv[], bool test);
const char *help;
- int (*load)(struct udev *udev);
- int (*unload)(struct udev *udev);
+ int (*init)(struct udev *udev);
+ int (*exit)(struct udev *udev);
bool run_once;
};
extern const struct udev_builtin udev_builtin_path_id;
goto out;
}
- udev_builtin_load(udev);
+ udev_builtin_init(udev);
cmd = udev_builtin_lookup(command);
if (cmd >= UDEV_BUILTIN_MAX) {
}
out:
udev_device_unref(dev);
- udev_builtin_unload(udev);
+ udev_builtin_exit(udev);
return rc;
}
sigprocmask(SIG_SETMASK, NULL, &sigmask_orig);
- udev_builtin_load(udev);
+ udev_builtin_init(udev);
rules = udev_rules_new(udev, resolve_names);
if (rules == NULL) {
udev_event_unref(event);
udev_device_unref(dev);
udev_rules_unref(rules);
- udev_builtin_unload(udev);
+ udev_builtin_exit(udev);
return rc;
}
}
fd_worker = worker_watch[READ_END];
- udev_builtin_load(udev);
+ udev_builtin_init(udev);
rules = udev_rules_new(udev, resolve_names);
if (rules == NULL) {
}
reload_config = 0;
- udev_builtin_unload(udev);
- udev_builtin_load(udev);
+ udev_builtin_exit(udev);
+ udev_builtin_init(udev);
}
}
worker_list_cleanup(udev);
event_queue_cleanup(udev, EVENT_UNDEF);
udev_rules_unref(rules);
- udev_builtin_unload(udev);
+ udev_builtin_exit(udev);
if (fd_signal >= 0)
close(fd_signal);
if (worker_watch[READ_END] >= 0)