From: Daniel Wagner Date: Tue, 20 Dec 2011 14:23:19 +0000 (+0100) Subject: dundee: Add driver helper functions X-Git-Tag: 1.7~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5091c3caffe6d6ba1b45cf1ed1311ed165c6a1f9;p=platform%2Fupstream%2Fofono.git dundee: Add driver helper functions --- diff --git a/dundee/device.c b/dundee/device.c index 9ed1687..1a83f76 100644 --- a/dundee/device.c +++ b/dundee/device.c @@ -41,6 +41,7 @@ struct dundee_device { struct dundee_device_driver *driver; gboolean registered; + void *data; }; const char *__dundee_device_get_path(struct dundee_device *device) @@ -135,6 +136,23 @@ void dundee_device_unregister(struct dundee_device *device) g_hash_table_remove(device_hash, device->path); } +void dundee_device_set_data(struct dundee_device *device, void *data) +{ + device->data = data; +} + +void *dundee_device_get_data(struct dundee_device *device) +{ + return device->data; +} + +int dundee_device_set_name(struct dundee_device *device, const char *name) +{ + DBG("%p name %s", device, name); + + return 0; +} + static void device_shutdown(gpointer key, gpointer value, gpointer user_data) { struct dundee_device *device = value; diff --git a/dundee/dundee.h b/dundee/dundee.h index ae14e01..cf0c36a 100644 --- a/dundee/dundee.h +++ b/dundee/dundee.h @@ -126,6 +126,11 @@ struct dundee_device *dundee_device_create(struct dundee_device_driver *d); int dundee_device_register(struct dundee_device *device); void dundee_device_unregister(struct dundee_device *device); +void dundee_device_set_data(struct dundee_device *device, void *data); +void *dundee_device_get_data(struct dundee_device *device); + +int dundee_device_set_name(struct dundee_device *device, const char *name); + typedef void (*dundee_device_foreach_func)(struct dundee_device *device, void *data); void __dundee_device_foreach(dundee_device_foreach_func cb, void *userdata);