base-manager: never create kernel device objects for remove events
There is no point in creating a new kernel device object just to process a remove event; instead, do any matching with existing kernel device objects by subsystem and name, which is what the generic backend already did anyway. This avoids unnecessary lookup of information in sysfs during removal events, because the port is anyway already gone when we try to look those up.
This commit is contained in:
+13
-8
@@ -67,14 +67,19 @@ MMDevice *mm_device_new (const gchar *uid,
|
||||
gboolean virtual,
|
||||
GDBusObjectManagerServer *object_manager);
|
||||
|
||||
void mm_device_grab_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
void mm_device_release_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
gboolean mm_device_owns_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
void mm_device_ignore_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
void mm_device_grab_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
gboolean mm_device_owns_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
void mm_device_ignore_port (MMDevice *self,
|
||||
MMKernelDevice *kernel_port);
|
||||
|
||||
gboolean mm_device_owns_port_name (MMDevice *self,
|
||||
const gchar *subsystem,
|
||||
const gchar *name);
|
||||
void mm_device_release_port_name (MMDevice *self,
|
||||
const gchar *subsystem,
|
||||
const gchar *name);
|
||||
|
||||
gboolean mm_device_create_modem (MMDevice *self,
|
||||
GError **error);
|
||||
|
||||
Reference in New Issue
Block a user