trivial: don't allow G_FILE_MONITOR_EVENT_DELETED events

The kernel doesn't ever destroy the acpi platform profile driver
or intel-pstate drivers at runtime.
This commit is contained in:
Mario Limonciello 2024-04-01 16:19:45 -05:00 committed by Mario Limonciello
parent 2ec541edc0
commit b26caea438
2 changed files with 10 additions and 2 deletions

View file

@ -90,7 +90,10 @@ no_turbo_changed (GFileMonitor *monitor,
g_autofree char *path = NULL;
path = g_file_get_path (file);
g_debug ("File monitor change happened for '%s'", path);
g_debug ("File monitor change happened for '%s' (event type %d)", path, event_type);
g_return_if_fail (event_type != G_FILE_MONITOR_EVENT_DELETED);
update_no_turbo (pstate);
}

View file

@ -195,7 +195,8 @@ lapmode_changed (GFileMonitor *monitor,
gpointer user_data)
{
PpdDriverPlatformProfile *self = user_data;
g_debug (LAPMODE_SYSFS_NAME " attribute changed");
g_debug (LAPMODE_SYSFS_NAME " attribute changed (event: %d)", event_type);
g_return_if_fail (event_type != G_FILE_MONITOR_EVENT_DELETED);
update_dytc_lapmode_state (self);
}
@ -207,11 +208,15 @@ acpi_platform_profile_changed (GFileMonitor *monitor,
gpointer user_data)
{
PpdDriverPlatformProfile *self = user_data;
g_debug (ACPI_PLATFORM_PROFILE_PATH " changed (%d)", event_type);
if (self->probe_result == PPD_PROBE_RESULT_DEFER) {
g_signal_emit_by_name (G_OBJECT (self), "probe-request", 0);
return;
}
g_return_if_fail (event_type != G_FILE_MONITOR_EVENT_DELETED);
update_acpi_platform_profile_state (self);
}