	- old lock initialisers got renamed
	- init_MUTEX_LOCKED got dropped, use the real sema_init instead
	- force sysfs-object creation
--- mISDN-1_1_9_2.orig/drivers/isdn/hardware/mISDN/core.c	2009-06-09 10:08:45.000000000 +0200
+++ mISDN-1_1_9_2/drivers/isdn/hardware/mISDN/core.c	2011-07-20 16:42:18.342001559 +0200
@@ -23,10 +23,10 @@ static char		*mISDN_core_version = MISDN
 static void (*dt_new_frame) (mISDNstack_t *stack, enum mISDN_dt_type type, struct sk_buff *skb, int duplicate_skb) = NULL;
 
 LIST_HEAD(mISDN_objectlist);
-static rwlock_t		mISDN_objects_lock = RW_LOCK_UNLOCKED;
+static rwlock_t		mISDN_objects_lock =  __RW_LOCK_UNLOCKED(old_style_rw_init);
 
 LIST_HEAD(mISDN_modulelist);
-static rwlock_t		mISDN_modules_lock = RW_LOCK_UNLOCKED;
+static rwlock_t		mISDN_modules_lock =  __RW_LOCK_UNLOCKED(old_style_rw_init);
 struct modulelist {
 	struct list_head list;
 	struct module *module;
@@ -35,7 +35,7 @@ struct modulelist {
 int core_debug;
 
 static u_char		entityarray[MISDN_MAX_ENTITY/8];
-static spinlock_t	entity_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t	entity_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init);
 
 static uint debug;
 static int obj_id;
@@ -724,7 +724,7 @@ int mISDN_register(mISDNobject_t *obj) {
 			obj->id);
 	if (core_debug & DEBUG_CORE_FUNC)
 		printk(KERN_DEBUG "mISDN_register: obj(%p)\n", obj);
-#ifndef SYSFS_SUPPORT_2_6_24
+//#ifndef SYSFS_SUPPORT_2_6_24
 	retval = mISDN_register_sysfs_obj(obj);
 	if (retval) {
 		printk(KERN_ERR "mISDN_register class_device_register return(%d)\n", retval);
@@ -732,7 +732,7 @@ int mISDN_register(mISDNobject_t *obj) {
 		list_del(&obj->list);
 		write_unlock_irqrestore(&mISDN_objects_lock, flags);
 	}
-#endif
+//#endif
 	return(retval);
 }
 
@@ -758,9 +758,10 @@ int mISDN_unregister(mISDNobject_t *obj)
 	if (core_debug & DEBUG_CORE_FUNC)
 		printk(KERN_DEBUG "mISDN_unregister: mISDN_objectlist(%p<-%p->%p)\n",
 			mISDN_objectlist.prev, &mISDN_objectlist, mISDN_objectlist.next);
+	mISDN_unregister_sysfs_obj(obj);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
 #ifdef SYSFS_SUPPORT
-        device_unregister(&obj->class_dev);
+        //device_unregister(&obj->class_dev);
 #endif
 #else
         class_device_unregister(&obj->class_dev);
@@ -774,7 +775,7 @@ mISDNInit(void)
 	struct semaphore sem;
 	int err;
 
-	init_MUTEX_LOCKED(&sem);
+	sema_init(&sem, 0);
 
 	printk(KERN_INFO "Modular ISDN Stack core version (%s) revision (%s)\n", mISDN_core_version, mISDN_core_revision);
 	core_debug = debug;
@@ -817,7 +818,7 @@ sysfs_fail:
 void mISDN_cleanup(void) {
 	struct semaphore sem;
 
-	init_MUTEX_LOCKED(&sem);
+	sema_init(&sem, 0);
 
 	free_mISDNdev();
 	if (!list_empty(&mISDN_objectlist)) {
