Merge branch 'cleanups' into 'main'

More cleanups

See merge request Librem5/feedbackd!80
This commit is contained in:
Guido Gunther
2022-11-11 09:50:28 +00:00
2 changed files with 14 additions and 13 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ device_changes (FbdFeedbackManager *self, gchar *action, GUdevDevice *device,
g_clear_object (&self->vibra);
}
} else if (g_strcmp0 (action, "add") == 0) {
if (!g_strcmp0 (g_udev_device_get_property (device, "FEEDBACKD_TYPE"), "vibra")) {
if (!g_strcmp0 (g_udev_device_get_property (device, FEEDBACKD_UDEV_ATTR), "vibra")) {
g_autoptr (GError) err = NULL;
g_debug ("Found hotplugged vibra device at %s", g_udev_device_get_sysfs_path (device));
@@ -139,7 +139,7 @@ init_devices (FbdFeedbackManager *self)
for (l = devices; l != NULL; l = l->next) {
GUdevDevice *dev = l->data;
if (!g_strcmp0 (g_udev_device_get_property (dev, "FEEDBACKD_TYPE"), "vibra")) {
if (!g_strcmp0 (g_udev_device_get_property (dev, FEEDBACKD_UDEV_ATTR), "vibra")) {
g_debug ("Found vibra device");
self->vibra = fbd_dev_vibra_new (dev, &err);
if (!self->vibra) {
+12 -11
View File
@@ -18,28 +18,29 @@
static GMainLoop *loop;
GQuark fbd_error_quark(void)
GQuark
fbd_error_quark (void)
{
static GQuark quark = 0;
static GQuark quark = 0;
if (!quark)
quark = g_quark_from_static_string("fbd");
if (!quark)
quark = g_quark_from_static_string("fbd");
return quark;
return quark;
}
static gboolean
quit_cb (gpointer user_data)
{
g_info ("Caught signal, shutting down...");
g_info ("Caught signal, shutting down...");
if (loop)
g_idle_add ((GSourceFunc) g_main_loop_quit, loop);
else
exit (0);
if (loop)
g_idle_add ((GSourceFunc) g_main_loop_quit, loop);
else
exit (0);
return FALSE;
return FALSE;
}
static gboolean