static void battery_destructor(plugin_instance *p) { battery_priv *c = (battery_priv *) p; ENTER; if (c->timer) g_source_remove(c->timer); PLUGIN_CLASS(k)->destructor(p); class_put("meter"); RET(); }
static void net_destructor(plugin_instance *p) { net_priv *c = (net_priv *) p; ENTER; if (c->timer) g_source_remove(c->timer); PLUGIN_CLASS(k)->destructor(p); class_put("chart"); RET(); }
static void volume_destructor(plugin_instance *p) { volume_priv *c = (volume_priv *) p; ENTER; g_source_remove(c->update_id); if (c->slider_window) gtk_widget_destroy(c->slider_window); PLUGIN_CLASS(k)->destructor(p); class_put("meter"); RET(); }
static void user_destructor(plugin_instance *p) { user_priv *c G_GNUC_UNUSED = (user_priv *) p; ENTER; PLUGIN_CLASS(k)->destructor(p); if (c->pid) kill(c->pid, SIGKILL); if (c->sid) g_source_remove(c->sid); class_put("menu"); RET(); }
/* * test_class_get * make test call to class_get which should return * a pointer to the class passed in and increase * the reference count to that kobject */ static int test_class_get() { int rc; struct class *tmp = NULL; /* get reference count before test call */ tmp = class_get(&test_class); if (tmp == &test_class) { printk("tbase: Success get class\n"); rc = 0; } else { printk("tbase: Failure get class\n"); rc = 1; } class_put(&test_class); return rc; }