linux: Move functions

No functional changes.
This commit is contained in:
Bastien Nocera 2021-06-17 10:52:04 +02:00
parent fa23d1be0c
commit 4496ebeb0a

View file

@ -93,6 +93,28 @@ input_switch_changed_cb (UpInput *input,
up_daemon_set_lid_is_closed (backend->priv->daemon, switch_value);
}
static gpointer
is_macbook (gpointer data)
{
char *product;
gboolean ret = FALSE;
product = sysfs_get_string ("/sys/devices/virtual/dmi/id/", "product_name");
if (product == NULL)
return GINT_TO_POINTER(ret);
ret = g_str_has_prefix (product, "MacBook");
g_free (product);
return GINT_TO_POINTER(ret);
}
gboolean
up_backend_needs_poll_after_uevent (void)
{
static GOnce dmi_once = G_ONCE_INIT;
g_once (&dmi_once, is_macbook, NULL);
return GPOINTER_TO_INT(dmi_once.retval);
}
static UpDevice *
up_backend_device_new (UpBackend *backend, GUdevDevice *native)
{
@ -281,28 +303,6 @@ up_backend_uevent_signal_handler_cb (GUdevClient *client, const gchar *action,
}
}
static gpointer
is_macbook (gpointer data)
{
char *product;
gboolean ret = FALSE;
product = sysfs_get_string ("/sys/devices/virtual/dmi/id/", "product_name");
if (product == NULL)
return GINT_TO_POINTER(ret);
ret = g_str_has_prefix (product, "MacBook");
g_free (product);
return GINT_TO_POINTER(ret);
}
gboolean
up_backend_needs_poll_after_uevent (void)
{
static GOnce dmi_once = G_ONCE_INIT;
g_once (&dmi_once, is_macbook, NULL);
return GPOINTER_TO_INT(dmi_once.retval);
}
static gboolean
is_battery_iface_proxy (GDBusProxy *interface_proxy)
{