diff options
Diffstat (limited to 'src/login/logind-device.c')
-rw-r--r-- | src/login/logind-device.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/login/logind-device.c b/src/login/logind-device.c index c5fe92bd60..76c5a5c88f 100644 --- a/src/login/logind-device.c +++ b/src/login/logind-device.c @@ -54,18 +54,7 @@ Device* device_new(Manager *m, const char *sysfs, bool master) { return d; } -void device_free(Device *d) { - assert(d); - - device_detach(d); - - hashmap_remove(d->manager->devices, d->sysfs); - - free(d->sysfs); - free(d); -} - -void device_detach(Device *d) { +static void device_detach(Device *d) { Seat *s; SessionDevice *sd; @@ -87,6 +76,17 @@ void device_detach(Device *d) { } } +void device_free(Device *d) { + assert(d); + + device_detach(d); + + hashmap_remove(d->manager->devices, d->sysfs); + + free(d->sysfs); + free(d); +} + void device_attach(Device *d, Seat *s) { Device *i; bool had_master; |