Commit 25e51c96 authored by Richard Hughes's avatar Richard Hughes

trivial: DkpDevice -> UpDevice (no ABI or API break)

parent d2550b4c
......@@ -72,6 +72,19 @@ typedef enum {
DKP_QOS_TYPE_LAST
} DkpQosType;
/* compat */
typedef DkpDeviceType UpDeviceType;
typedef DkpDeviceState UpDeviceState;
typedef DkpDeviceTechnology UpDeviceTechnology;
#define up_device_type_to_text dkp_device_type_to_text
#define up_device_state_to_text dkp_device_state_to_text
#define up_device_technology_to_text dkp_device_technology_to_text
#define up_qos_type_to_text dkp_qos_type_to_text
#define up_device_type_from_text dkp_device_type_from_text
#define up_device_state_from_text dkp_device_state_from_text
#define up_device_technology_from_text dkp_device_technology_from_text
#define up_qos_type_from_text dkp_qos_type_from_text
const gchar *dkp_device_type_to_text (DkpDeviceType type_enum);
const gchar *dkp_device_state_to_text (DkpDeviceState state_enum);
const gchar *dkp_device_technology_to_text (DkpDeviceTechnology technology_enum);
......
......@@ -48,7 +48,7 @@ up-daemon-glue.h: org.freedesktop.DeviceKit.Power.xml Makefile.am
dbus-binding-tool --prefix=up_daemon --mode=glib-server --output=up-daemon-glue.h org.freedesktop.DeviceKit.Power.xml
up-device-glue.h: org.freedesktop.DeviceKit.Power.Device.xml Makefile.am
dbus-binding-tool --prefix=dkp_device --mode=glib-server --output=up-device-glue.h org.freedesktop.DeviceKit.Power.Device.xml
dbus-binding-tool --prefix=up_device --mode=glib-server --output=up-device-glue.h org.freedesktop.DeviceKit.Power.Device.xml
up-qos-glue.h: org.freedesktop.DeviceKit.Power.QoS.xml Makefile.am
dbus-binding-tool --prefix=dkp_qos --mode=glib-server --output=up-qos-glue.h org.freedesktop.DeviceKit.Power.QoS.xml
......
......@@ -43,8 +43,8 @@ static void up_backend_finalize (GObject *object);
struct UpBackendPrivate
{
UpDaemon *daemon;
DkpDevice *device;
DkpDeviceList *device_list; /* unused */
UpDevice *device;
UpDeviceList *device_list; /* unused */
GObject *native;
};
......@@ -64,7 +64,7 @@ G_DEFINE_TYPE (UpBackend, up_backend, G_TYPE_OBJECT)
static gboolean
up_backend_changed_time_cb (UpBackend *backend)
{
DkpDevice *device;
UpDevice *device;
GTimeVal timeval;
//FIXME!
......@@ -85,7 +85,7 @@ up_backend_add_cb (UpBackend *backend)
gboolean ret;
/* coldplug */
ret = dkp_device_coldplug (backend->priv->device, backend->priv->daemon, backend->priv->native);
ret = up_device_coldplug (backend->priv->device, backend->priv->daemon, backend->priv->native);
if (!ret) {
egg_warning ("failed to coldplug");
goto out;
......@@ -157,8 +157,8 @@ up_backend_init (UpBackend *backend)
backend->priv = UP_BACKEND_GET_PRIVATE (backend);
backend->priv->daemon = NULL;
backend->priv->device_list = NULL;
backend->priv->native = g_object_new (DKP_TYPE_DEVICE, NULL);
backend->priv->device = dkp_device_new ();
backend->priv->native = g_object_new (UP_TYPE_DEVICE, NULL);
backend->priv->device = up_device_new ();
/* setup dummy */
g_object_set (backend->priv->device,
......
......@@ -64,7 +64,7 @@ static gboolean up_backend_supports_sleep_state (const gchar *state);
struct UpBackendPrivate
{
UpDaemon *daemon;
DkpDeviceList *device_list;
UpDeviceList *device_list;
GHashTable *handle_map;
guint poll_timer_id;
};
......@@ -95,15 +95,15 @@ up_backend_refresh_devices (gpointer user_data)
{
UpBackend *backend;
GPtrArray *array;
DkpDevice *device;
UpDevice *device;
guint i;
backend = UP_BACKEND (user_data);
array = dkp_device_list_get_array (backend->priv->device_list);
array = up_device_list_get_array (backend->priv->device_list);
for (i = 0; i < array->len; i++) {
device = DKP_DEVICE (g_ptr_array_index (array, i));
dkp_device_refresh_internal (device);
device = UP_DEVICE (g_ptr_array_index (array, i));
up_device_refresh_internal (device);
}
g_ptr_array_unref (array);
......@@ -125,7 +125,7 @@ up_backend_acpi_devd_notify (UpBackend *backend, const gchar *system, const gcha
if (!strcmp (subsystem, "ACAD")) {
native = dkp_acpi_native_new ("hw.acpi.acline");
object = dkp_device_list_lookup (backend->priv->device_list, G_OBJECT (native));
object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (native));
} else if (!strcmp (subsystem, "CMBAT")) {
gchar *ptr;
int unit;
......@@ -134,13 +134,13 @@ up_backend_acpi_devd_notify (UpBackend *backend, const gchar *system, const gcha
if (ptr != NULL && sscanf (ptr, ".BAT%i", &unit)) {
native = dkp_acpi_native_new_driver_unit ("battery", unit);
object = dkp_device_list_lookup (backend->priv->device_list, G_OBJECT (native));
object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (native));
if (object == NULL) {
gpointer hptr;
hptr = g_hash_table_lookup (backend->priv->handle_map, type);
if (hptr != NULL) {
object = dkp_device_list_lookup (backend->priv->device_list, G_OBJECT (hptr));
object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (hptr));
}
}
}
......@@ -171,7 +171,7 @@ up_backend_acpi_devd_notify (UpBackend *backend, const gchar *system, const gcha
goto out;
}
dkp_device_refresh_internal (DKP_DEVICE (object));
up_device_refresh_internal (UP_DEVICE (object));
if (object != NULL)
g_object_unref (object);
......@@ -188,11 +188,11 @@ out:
static gboolean
up_backend_create_new_device (UpBackend *backend, DkpAcpiNative *native)
{
DkpDevice *device;
UpDevice *device;
gboolean ret;
device = DKP_DEVICE (dkp_device_supply_new ());
ret = dkp_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
device = UP_DEVICE (up_device_supply_new ());
ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
if (!ret)
g_object_unref (device);
else {
......@@ -260,15 +260,15 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon)
for (j = 0; dkp_has_sysctl ("dev.%s.%i.%%driver", handlers[i], j); j++) {
DkpAcpiNative *native;
DkpDevice *device;
UpDevice *device;
GObject *object;
native = dkp_acpi_native_new_driver_unit (handlers[i], j);
object = dkp_device_list_lookup (backend->priv->device_list, G_OBJECT (native));
object = up_device_list_lookup (backend->priv->device_list, G_OBJECT (native));
if (object != NULL) {
device = DKP_DEVICE (object);
egg_warning ("treating add event as change event on %s", dkp_device_get_object_path (device));
dkp_device_refresh_internal (device);
device = UP_DEVICE (object);
egg_warning ("treating add event as change event on %s", up_device_get_object_path (device));
up_device_refresh_internal (device);
} else {
up_backend_create_new_device (backend, native);
}
......
......@@ -47,25 +47,25 @@
#define DKP_ACPIDEV "/dev/acpi"
G_DEFINE_TYPE (DkpDeviceSupply, dkp_device_supply, DKP_TYPE_DEVICE)
static gboolean dkp_device_supply_refresh (DkpDevice *device);
static DkpDeviceTechnology dkp_device_supply_convert_device_technology (const gchar *type);
static gboolean dkp_device_supply_acline_coldplug (DkpDevice *device);
static gboolean dkp_device_supply_battery_coldplug (DkpDevice *device, DkpAcpiNative *native);
static gboolean dkp_device_supply_acline_set_properties (DkpDevice *device);
static gboolean dkp_device_supply_battery_set_properties (DkpDevice *device, DkpAcpiNative *native);
static gboolean dkp_device_supply_get_on_battery (DkpDevice *device, gboolean *on_battery);
static gboolean dkp_device_supply_get_low_battery (DkpDevice *device, gboolean *low_battery);
static gboolean dkp_device_supply_get_online (DkpDevice *device, gboolean *online);
G_DEFINE_TYPE (UpDeviceSupply, up_device_supply, UP_TYPE_DEVICE)
static gboolean up_device_supply_refresh (UpDevice *device);
static UpDeviceTechnology up_device_supply_convert_device_technology (const gchar *type);
static gboolean up_device_supply_acline_coldplug (UpDevice *device);
static gboolean up_device_supply_battery_coldplug (UpDevice *device, DkpAcpiNative *native);
static gboolean up_device_supply_acline_set_properties (UpDevice *device);
static gboolean up_device_supply_battery_set_properties (UpDevice *device, DkpAcpiNative *native);
static gboolean up_device_supply_get_on_battery (UpDevice *device, gboolean *on_battery);
static gboolean up_device_supply_get_low_battery (UpDevice *device, gboolean *low_battery);
static gboolean up_device_supply_get_online (UpDevice *device, gboolean *online);
/**
* dkp_device_supply_convert_device_technology:
* up_device_supply_convert_device_technology:
*
* This is taken from linux/dkp-device-supply.c.
**/
static DkpDeviceTechnology
dkp_device_supply_convert_device_technology (const gchar *type)
static UpDeviceTechnology
up_device_supply_convert_device_technology (const gchar *type)
{
if (type == NULL)
return DKP_DEVICE_TECHNOLOGY_UNKNOWN;
......@@ -87,10 +87,10 @@ dkp_device_supply_convert_device_technology (const gchar *type)
}
/**
* dkp_device_supply_reset_values:
* up_device_supply_reset_values:
**/
static void
dkp_device_supply_reset_values (DkpDevice *device)
up_device_supply_reset_values (UpDevice *device)
{
/* reset to default */
g_object_set (device,
......@@ -120,10 +120,10 @@ dkp_device_supply_reset_values (DkpDevice *device)
}
/**
* dkp_device_supply_acline_coldplug:
* up_device_supply_acline_coldplug:
**/
static gboolean
dkp_device_supply_acline_coldplug (DkpDevice *device)
up_device_supply_acline_coldplug (UpDevice *device)
{
gboolean ret;
......@@ -133,30 +133,30 @@ dkp_device_supply_acline_coldplug (DkpDevice *device)
"type", DKP_DEVICE_TYPE_LINE_POWER,
NULL);
ret = dkp_device_supply_acline_set_properties (device);
ret = up_device_supply_acline_set_properties (device);
return ret;
}
/**
* dkp_device_supply_battery_coldplug:
* up_device_supply_battery_coldplug:
**/
static gboolean
dkp_device_supply_battery_coldplug (DkpDevice *device, DkpAcpiNative *native)
up_device_supply_battery_coldplug (UpDevice *device, DkpAcpiNative *native)
{
gboolean ret;
g_object_set (device, "type", DKP_DEVICE_TYPE_BATTERY, NULL);
ret = dkp_device_supply_battery_set_properties (device, native);
ret = up_device_supply_battery_set_properties (device, native);
return ret;
}
/**
* dkp_device_supply_battery_set_properties:
* up_device_supply_battery_set_properties:
**/
static gboolean
dkp_device_supply_battery_set_properties (DkpDevice *device, DkpAcpiNative *native)
up_device_supply_battery_set_properties (UpDevice *device, DkpAcpiNative *native)
{
gint fd;
gdouble volt, dvolt, rate, lastfull, cap, dcap, lcap, capacity;
......@@ -164,8 +164,8 @@ dkp_device_supply_battery_set_properties (DkpDevice *device, DkpAcpiNative *nati
gboolean ret = FALSE;
guint64 time_to_empty, time_to_full;
gchar *vendor, *model, *serial;
DkpDeviceTechnology technology;
DkpDeviceState state;
UpDeviceTechnology technology;
UpDeviceState state;
union acpi_battery_ioctl_arg battif, battst, battinfo;
if (!dkp_has_sysctl ("hw.acpi.battery.units"))
......@@ -200,14 +200,14 @@ dkp_device_supply_battery_set_properties (DkpDevice *device, DkpAcpiNative *nati
g_object_set (device, "is-present", is_present, NULL);
if (!is_present) {
dkp_device_supply_reset_values (device);
up_device_supply_reset_values (device);
goto end;
}
vendor = dkp_make_safe_string (battif.bif.oeminfo);
model = dkp_make_safe_string (battif.bif.model);
serial = dkp_make_safe_string (battif.bif.serial);
technology = dkp_device_supply_convert_device_technology (battif.bif.type);
technology = up_device_supply_convert_device_technology (battif.bif.type);
g_object_set (device,
"vendor", vendor,
......@@ -323,10 +323,10 @@ end:
}
/**
* dkp_device_supply_acline_set_properties:
* up_device_supply_acline_set_properties:
**/
static gboolean
dkp_device_supply_acline_set_properties (DkpDevice *device)
up_device_supply_acline_set_properties (UpDevice *device)
{
int acstate;
......@@ -339,20 +339,20 @@ dkp_device_supply_acline_set_properties (DkpDevice *device)
}
/**
* dkp_device_supply_coldplug:
* up_device_supply_coldplug:
* Return %TRUE on success, %FALSE if we failed to get data and should be removed
**/
static gboolean
dkp_device_supply_coldplug (DkpDevice *device)
up_device_supply_coldplug (UpDevice *device)
{
DkpAcpiNative *native;
const gchar *native_path;
const gchar *driver;
gboolean ret = FALSE;
dkp_device_supply_reset_values (device);
up_device_supply_reset_values (device);
native = DKP_ACPI_NATIVE (dkp_device_get_native (device));
native = DKP_ACPI_NATIVE (up_device_get_native (device));
native_path = dkp_acpi_native_get_path (native);
driver = dkp_acpi_native_get_driver (native);
if (native_path == NULL) {
......@@ -361,12 +361,12 @@ dkp_device_supply_coldplug (DkpDevice *device)
}
if (!strcmp (native_path, "hw.acpi.acline")) {
ret = dkp_device_supply_acline_coldplug (device);
ret = up_device_supply_acline_coldplug (device);
goto out;
}
if (!g_strcmp0 (driver, "battery")) {
ret = dkp_device_supply_battery_coldplug (device, native);
ret = up_device_supply_battery_coldplug (device, native);
goto out;
}
......@@ -377,26 +377,26 @@ out:
}
/**
* dkp_device_supply_refresh:
* up_device_supply_refresh:
*
* Return %TRUE on success, %FALSE if we failed to refresh or no data
**/
static gboolean
dkp_device_supply_refresh (DkpDevice *device)
up_device_supply_refresh (UpDevice *device)
{
GObject *object;
GTimeVal timeval;
DkpDeviceType type;
UpDeviceType type;
gboolean ret;
g_object_get (device, "type", &type, NULL);
switch (type) {
case DKP_DEVICE_TYPE_LINE_POWER:
ret = dkp_device_supply_acline_set_properties (device);
ret = up_device_supply_acline_set_properties (device);
break;
case DKP_DEVICE_TYPE_BATTERY:
object = dkp_device_get_native (device);
ret = dkp_device_supply_battery_set_properties (device, DKP_ACPI_NATIVE (object));
object = up_device_get_native (device);
ret = up_device_supply_battery_set_properties (device, DKP_ACPI_NATIVE (object));
break;
default:
g_assert_not_reached ();
......@@ -412,13 +412,13 @@ dkp_device_supply_refresh (DkpDevice *device)
}
/**
* dkp_device_supply_get_on_battery:
* up_device_supply_get_on_battery:
**/
static gboolean
dkp_device_supply_get_on_battery (DkpDevice *device, gboolean *on_battery)
up_device_supply_get_on_battery (UpDevice *device, gboolean *on_battery)
{
DkpDeviceType type;
DkpDeviceState state;
UpDeviceType type;
UpDeviceState state;
gboolean is_present;
g_return_val_if_fail (on_battery != NULL, FALSE);
......@@ -441,10 +441,10 @@ dkp_device_supply_get_on_battery (DkpDevice *device, gboolean *on_battery)
}
/**
* dkp_device_supply_get_low_battery:
* up_device_supply_get_low_battery:
**/
static gboolean
dkp_device_supply_get_low_battery (DkpDevice *device, gboolean *low_battery)
up_device_supply_get_low_battery (UpDevice *device, gboolean *low_battery)
{
gboolean ret;
gboolean on_battery;
......@@ -452,7 +452,7 @@ dkp_device_supply_get_low_battery (DkpDevice *device, gboolean *low_battery)
g_return_val_if_fail (low_battery != NULL, FALSE);
ret = dkp_device_supply_get_on_battery (device, &on_battery);
ret = up_device_supply_get_on_battery (device, &on_battery);
if (!ret)
return FALSE;
......@@ -467,12 +467,12 @@ dkp_device_supply_get_low_battery (DkpDevice *device, gboolean *low_battery)
}
/**
* dkp_device_supply_get_online:
* up_device_supply_get_online:
**/
static gboolean
dkp_device_supply_get_online (DkpDevice *device, gboolean *online)
up_device_supply_get_online (UpDevice *device, gboolean *online)
{
DkpDeviceType type;
UpDeviceType type;
gboolean online_tmp;
g_return_val_if_fail (online != NULL, FALSE);
......@@ -491,52 +491,52 @@ dkp_device_supply_get_online (DkpDevice *device, gboolean *online)
}
/**
* dkp_device_supply_init:
* up_device_supply_init:
**/
static void
dkp_device_supply_init (DkpDeviceSupply *supply)
up_device_supply_init (UpDeviceSupply *supply)
{
}
/**
* dkp_device_supply_finalize:
* up_device_supply_finalize:
**/
static void
dkp_device_supply_finalize (GObject *object)
up_device_supply_finalize (GObject *object)
{
DkpDeviceSupply *supply;
UpDeviceSupply *supply;
g_return_if_fail (object != NULL);
g_return_if_fail (DKP_IS_SUPPLY (object));
g_return_if_fail (UP_IS_DEVICE_SUPPLY (object));
supply = DKP_DEVICE_SUPPLY (object);
supply = UP_DEVICE_SUPPLY (object);
G_OBJECT_CLASS (dkp_device_supply_parent_class)->finalize (object);
G_OBJECT_CLASS (up_device_supply_parent_class)->finalize (object);
}
/**
* dkp_device_supply_class_init:
* up_device_supply_class_init:
**/
static void
dkp_device_supply_class_init (DkpDeviceSupplyClass *klass)
up_device_supply_class_init (UpDeviceSupplyClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
DkpDeviceClass *device_class = DKP_DEVICE_CLASS (klass);
object_class->finalize = dkp_device_supply_finalize;
device_class->get_on_battery = dkp_device_supply_get_on_battery;
device_class->get_low_battery = dkp_device_supply_get_low_battery;
device_class->get_online = dkp_device_supply_get_online;
device_class->coldplug = dkp_device_supply_coldplug;
device_class->refresh = dkp_device_supply_refresh;
UpDeviceClass *device_class = UP_DEVICE_CLASS (klass);
object_class->finalize = up_device_supply_finalize;
device_class->get_on_battery = up_device_supply_get_on_battery;
device_class->get_low_battery = up_device_supply_get_low_battery;
device_class->get_online = up_device_supply_get_online;
device_class->coldplug = up_device_supply_coldplug;
device_class->refresh = up_device_supply_refresh;
}
/**
* dkp_device_supply_new:
* up_device_supply_new:
**/
DkpDeviceSupply *
dkp_device_supply_new (void)
UpDeviceSupply *
up_device_supply_new (void)
{
return g_object_new (DKP_TYPE_SUPPLY, NULL);
return g_object_new (UP_TYPE_DEVICE_SUPPLY, NULL);
}
......@@ -19,38 +19,38 @@
*
*/
#ifndef __DKP_DEVICE_SUPPLY_H__
#define __DKP_DEVICE_SUPPLY_H__
#ifndef __UP_DEVICE_SUPPLY_H__
#define __UP_DEVICE_SUPPLY_H__
#include <glib-object.h>
#include "up-device.h"
G_BEGIN_DECLS
#define DKP_TYPE_SUPPLY (dkp_device_supply_get_type ())
#define DKP_DEVICE_SUPPLY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DKP_TYPE_SUPPLY, DkpDeviceSupply))
#define DKP_DEVICE_SUPPLY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DKP_TYPE_SUPPLY, DkpDeviceSupplyClass))
#define DKP_IS_SUPPLY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DKP_TYPE_SUPPLY))
#define DKP_IS_SUPPLY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DKP_TYPE_SUPPLY))
#define DKP_DEVICE_SUPPLY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DKP_TYPE_SUPPLY, DkpDeviceSupplyClass))
#define UP_TYPE_DEVICE_SUPPLY (up_device_supply_get_type ())
#define UP_DEVICE_SUPPLY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UP_TYPE_DEVICE_SUPPLY, UpDeviceSupply))
#define UP_DEVICE_SUPPLY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UP_TYPE_DEVICE_SUPPLY, UpDeviceSupplyClass))
#define UP_IS_DEVICE_SUPPLY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UP_TYPE_DEVICE_SUPPLY))
#define UP_IS_DEVICE_SUPPLY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UP_TYPE_DEVICE_SUPPLY))
#define UP_DEVICE_SUPPLY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UP_TYPE_DEVICE_SUPPLY, UpDeviceSupplyClass))
typedef struct DkpDeviceSupplyPrivate DkpDeviceSupplyPrivate;
typedef struct UpDeviceSupplyPrivate UpDeviceSupplyPrivate;
typedef struct
{
DkpDevice parent;
DkpDeviceSupplyPrivate *priv;
} DkpDeviceSupply;
UpDevice parent;
UpDeviceSupplyPrivate *priv;
} UpDeviceSupply;
typedef struct
{
DkpDeviceClass parent_class;
} DkpDeviceSupplyClass;
UpDeviceClass parent_class;
} UpDeviceSupplyClass;
GType dkp_device_supply_get_type (void);
DkpDeviceSupply *dkp_device_supply_new (void);
GType up_device_supply_get_type (void);
UpDeviceSupply *up_device_supply_new (void);
G_END_DECLS
#endif /* __DKP_DEVICE_SUPPLY_H__ */
#endif /* __UP_DEVICE_SUPPLY_H__ */
......@@ -50,9 +50,9 @@ static void up_backend_finalize (GObject *object);
struct UpBackendPrivate
{
UpDaemon *daemon;
DkpDeviceList *device_list;
UpDeviceList *device_list;
GUdevClient *gudev_client;
DkpDeviceList *managed_devices;
UpDeviceList *managed_devices;
};
enum {
......@@ -71,12 +71,12 @@ static void up_backend_device_remove (UpBackend *backend, GUdevDevice *native);
/**
* up_backend_device_new:
**/
static DkpDevice *
static UpDevice *
up_backend_device_new (UpBackend *backend, GUdevDevice *native)
{
const gchar *subsys;
const gchar *native_path;
DkpDevice *device = NULL;
UpDevice *device = NULL;
DkpInput *input;
gboolean ret;
......@@ -84,8 +84,8 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
if (g_strcmp0 (subsys, "power_supply") == 0) {
/* are we a valid power supply */
device = DKP_DEVICE (dkp_device_supply_new ());
ret = dkp_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
device = UP_DEVICE (up_device_supply_new ());
ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
if (ret)
goto out;
g_object_unref (device);
......@@ -96,8 +96,8 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
} else if (g_strcmp0 (subsys, "tty") == 0) {
/* try to detect a Watts Up? Pro monitor */
device = DKP_DEVICE (dkp_device_wup_new ());
ret = dkp_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
device = UP_DEVICE (up_device_wup_new ());
ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
if (ret)
goto out;
g_object_unref (device);
......@@ -108,15 +108,15 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
} else if (g_strcmp0 (subsys, "usb") == 0) {
/* see if this is a CSR mouse or keyboard */
device = DKP_DEVICE (dkp_device_csr_new ());
ret = dkp_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
device = UP_DEVICE (up_device_csr_new ());
ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
if (ret)
goto out;
g_object_unref (device);
/* try to detect a HID UPS */
device = DKP_DEVICE (dkp_device_hid_new ());
ret = dkp_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
device = UP_DEVICE (up_device_hid_new ());
ret = up_device_coldplug (device, backend->priv->daemon, G_OBJECT (native));
if (ret)
goto out;
g_object_unref (device);
......@@ -140,7 +140,7 @@ up_backend_device_new (UpBackend *backend, GUdevDevice *native)
NULL);
/* not a power device */
dkp_device_list_insert (backend->priv->managed_devices, G_OBJECT (native), G_OBJECT (input));
up_device_list_insert (backend->pr