chiark / gitweb /
get rid of 'linked' notion for objects
[elogind.git] / device.c
index 79847c46b7cea39eeb25ddc5be18adca80da384d..ec0a40a4df6561c333226057b5702662e5640a3d 100644 (file)
--- a/device.c
+++ b/device.c
@@ -4,6 +4,13 @@
 #include "device.h"
 #include "strv.h"
 
+static void device_done(Name *n) {
+        Device *d = DEVICE(n);
+
+        assert(d);
+        strv_free(d->sysfs);
+}
+
 static void device_dump(Name *n, FILE *f, const char *prefix) {
 
         static const char* const state_table[_DEVICE_STATE_MAX] = {
@@ -24,24 +31,12 @@ static NameActiveState device_active_state(Name *n) {
         return DEVICE(n)->state == DEVICE_DEAD ? NAME_INACTIVE : NAME_ACTIVE;
 }
 
-static void device_free_hook(Name *n) {
-        Device *d = DEVICE(n);
-
-        assert(d);
-        strv_free(d->sysfs);
-}
-
 const NameVTable device_vtable = {
         .suffix = ".device",
 
-        .load = name_load_fragment_and_dropin,
+        .init = name_load_fragment_and_dropin,
+        .done = device_done,
         .dump = device_dump,
 
-        .start = NULL,
-        .stop = NULL,
-        .reload = NULL,
-
-        .active_state = device_active_state,
-
-        .free_hook = device_free_hook
+        .active_state = device_active_state
 };