## Automatically generated incremental diff
## From:   linux-2.5.68-bk9
## To:     linux-2.5.68-bk10
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.5.68-bk9/Documentation/filesystems/Locking linux-2.5.68-bk10/Documentation/filesystems/Locking
--- linux-2.5.68-bk9/Documentation/filesystems/Locking	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk10/Documentation/filesystems/Locking	2003-04-30 04:34:54.000000000 -0700
@@ -18,13 +18,13 @@
 
 locking rules:
 	none have BKL
-		dcache_lock	may block
-d_revalidate:	no		yes
-d_hash		no		yes
-d_compare:	no		no 
-d_delete:	yes		no
-d_release:	no		yes
-d_iput:		no		yes
+		dcache_lock	rename_lock	->d_lock	may block
+d_revalidate:	no		no		no		yes
+d_hash		no		no		no		yes
+d_compare:	no		yes		no		no 
+d_delete:	yes		no		yes		no
+d_release:	no		no		no		yes
+d_iput:		no		no		no		yes
 
 --------------------------- inode_operations --------------------------- 
 prototypes:
diff -urN linux-2.5.68-bk9/Makefile linux-2.5.68-bk10/Makefile
--- linux-2.5.68-bk9/Makefile	2003-04-30 04:34:48.000000000 -0700
+++ linux-2.5.68-bk10/Makefile	2003-04-30 04:34:54.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 68
-EXTRAVERSION = -bk9
+EXTRAVERSION = -bk10
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
diff -urN linux-2.5.68-bk9/drivers/base/Makefile linux-2.5.68-bk10/drivers/base/Makefile
--- linux-2.5.68-bk9/drivers/base/Makefile	2003-04-19 19:50:40.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/Makefile	2003-04-30 04:34:54.000000000 -0700
@@ -1,8 +1,6 @@
 # Makefile for the Linux device tree
 
 obj-y			:= core.o sys.o interface.o power.o bus.o \
-			   driver.o class.o intf.o platform.o \
+			   driver.o class.o platform.o \
 			   cpu.o firmware.o init.o
 obj-$(CONFIG_NUMA)	+= node.o  memblk.o
-obj-y			+= fs/
-obj-$(CONFIG_HOTPLUG)	+= hotplug.o
diff -urN linux-2.5.68-bk9/drivers/base/base.h linux-2.5.68-bk10/drivers/base/base.h
--- linux-2.5.68-bk9/drivers/base/base.h	2003-04-19 19:49:10.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/base.h	2003-04-30 04:34:54.000000000 -0700
@@ -1,5 +1,4 @@
 extern struct semaphore device_sem;
-extern struct semaphore devclass_sem;
 
 extern int bus_add_device(struct device * dev);
 extern void bus_remove_device(struct device * dev);
@@ -7,22 +6,3 @@
 extern int bus_add_driver(struct device_driver *);
 extern void bus_remove_driver(struct device_driver *);
 
-extern int devclass_add_device(struct device *);
-extern void devclass_remove_device(struct device *);
-
-extern int devclass_add_driver(struct device_driver *);
-extern void devclass_remove_driver(struct device_driver *);
-
-extern int interface_add_dev(struct device *);
-extern void interface_remove_dev(struct device *);
-
-
-#ifdef CONFIG_HOTPLUG
-extern int class_hotplug(struct device *dev, const char *action);
-#else
-static inline int class_hotplug(struct device *dev, const char *action)
-{
-	return 0;
-}
-#endif
-
diff -urN linux-2.5.68-bk9/drivers/base/bus.c linux-2.5.68-bk10/drivers/base/bus.c
--- linux-2.5.68-bk9/drivers/base/bus.c	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/bus.c	2003-04-30 04:34:54.000000000 -0700
@@ -311,8 +311,7 @@
  *	Walk the list of devices that the bus has on it and try to match
  *	the driver with each one.
  *	If bus_match() returns 0 and the @dev->driver is set, we've found
- *	a compatible pair, so we call devclass_add_device() to add the 
- *	device to the class. 
+ *	a compatible pair.
  *
  *	Note that we ignore the error from bus_match(), since it's perfectly
  *	valid for a driver not to bind to any devices.
@@ -328,8 +327,7 @@
 	list_for_each(entry,&bus->devices.list) {
 		struct device * dev = container_of(entry,struct device,bus_list);
 		if (!dev->driver) {
-			if (!bus_match(dev,drv))
-				devclass_add_device(dev);
+			bus_match(dev,drv);
 		}
 	}
 }
@@ -351,7 +349,6 @@
 	if (drv) {
 		sysfs_remove_link(&drv->kobj,dev->kobj.name);
 		list_del_init(&dev->driver_list);
-		devclass_remove_device(dev);
 		if (drv->remove)
 			drv->remove(dev);
 		dev->driver = NULL;
@@ -443,8 +440,7 @@
 		}
 
 		down_write(&bus->subsys.rwsem);
-		if (!(error = devclass_add_driver(drv)))
-			driver_attach(drv);
+		driver_attach(drv);
 		up_write(&bus->subsys.rwsem);
 
 		if (error) {
@@ -471,7 +467,6 @@
 		down_write(&drv->bus->subsys.rwsem);
 		pr_debug("bus %s: remove driver %s\n",drv->bus->name,drv->name);
 		driver_detach(drv);
-		devclass_remove_driver(drv);
 		up_write(&drv->bus->subsys.rwsem);
 		kobject_unregister(&drv->kobj);
 		put_bus(drv->bus);
diff -urN linux-2.5.68-bk9/drivers/base/class.c linux-2.5.68-bk10/drivers/base/class.c
--- linux-2.5.68-bk9/drivers/base/class.c	2003-04-19 19:51:14.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/class.c	2003-04-30 04:34:54.000000000 -0700
@@ -1,5 +1,7 @@
 /*
  * class.c - basic device class management
+ * 
+ * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
  */
 
 #undef DEBUG
@@ -10,16 +12,14 @@
 #include <linux/string.h>
 #include "base.h"
 
-#define to_class_attr(_attr) container_of(_attr,struct devclass_attribute,attr)
-#define to_class(obj) container_of(obj,struct device_class,subsys.kset.kobj)
-
-DECLARE_MUTEX(devclass_sem);
+#define to_class_attr(_attr) container_of(_attr,struct class_attribute,attr)
+#define to_class(obj) container_of(obj,struct class,subsys.kset.kobj)
 
 static ssize_t
-devclass_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
+class_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 {
-	struct devclass_attribute * class_attr = to_class_attr(attr);
-	struct device_class * dc = to_class(kobj);
+	struct class_attribute * class_attr = to_class_attr(attr);
+	struct class * dc = to_class(kobj);
 	ssize_t ret = 0;
 
 	if (class_attr->show)
@@ -28,11 +28,11 @@
 }
 
 static ssize_t
-devclass_attr_store(struct kobject * kobj, struct attribute * attr, 
-		    const char * buf, size_t count)
+class_attr_store(struct kobject * kobj, struct attribute * attr, 
+		 const char * buf, size_t count)
 {
-	struct devclass_attribute * class_attr = to_class_attr(attr);
-	struct device_class * dc = to_class(kobj);
+	struct class_attribute * class_attr = to_class_attr(attr);
+	struct class * dc = to_class(kobj);
 	ssize_t ret = 0;
 
 	if (class_attr->store)
@@ -41,242 +41,376 @@
 }
 
 static struct sysfs_ops class_sysfs_ops = {
-	.show	= devclass_attr_show,
-	.store	= devclass_attr_store,
+	.show	= class_attr_show,
+	.store	= class_attr_store,
 };
 
-static struct kobj_type ktype_devclass = {
+static struct kobj_type ktype_class = {
 	.sysfs_ops	= &class_sysfs_ops,
 };
 
-/* Classes can't use the kobject hotplug logic, as
- * they do not add new kobjects to the system */
-static decl_subsys(class,&ktype_devclass,NULL);
+/* Hotplug events for classes go to the class_obj subsys */
+static decl_subsys(class,&ktype_class,NULL);
 
 
-static int devclass_dev_link(struct device_class * cls, struct device * dev)
+int class_create_file(struct class * cls, struct class_attribute * attr)
 {
-	char	linkname[16];
-	snprintf(linkname,16,"%u",dev->class_num);
-	return sysfs_create_link(&cls->devices.kobj,&dev->kobj,linkname);
+	int error;
+	if (cls) {
+		error = sysfs_create_file(&cls->subsys.kset.kobj,&attr->attr);
+	} else
+		error = -EINVAL;
+	return error;
 }
 
-static void devclass_dev_unlink(struct device_class * cls, struct device * dev)
+void class_remove_file(struct class * cls, struct class_attribute * attr)
 {
-	char	linkname[16];
-	snprintf(linkname,16,"%u",dev->class_num);
-	sysfs_remove_link(&cls->devices.kobj,linkname);
+	if (cls)
+		sysfs_remove_file(&cls->subsys.kset.kobj,&attr->attr);
 }
 
-static int devclass_drv_link(struct device_driver * drv)
+struct class * class_get(struct class * cls)
 {
-	char	name[KOBJ_NAME_LEN * 3];
-	snprintf(name,KOBJ_NAME_LEN * 3,"%s:%s",drv->bus->name,drv->name);
-	return sysfs_create_link(&drv->devclass->drivers.kobj,&drv->kobj,name);
+	if (cls)
+		return container_of(subsys_get(&cls->subsys),struct class,subsys);
+	return NULL;
 }
 
-static void devclass_drv_unlink(struct device_driver * drv)
+void class_put(struct class * cls)
 {
-	char	name[KOBJ_NAME_LEN * 3];
-	snprintf(name,KOBJ_NAME_LEN * 3,"%s:%s",drv->bus->name,drv->name);
-	return sysfs_remove_link(&drv->devclass->drivers.kobj,name);
+	subsys_put(&cls->subsys);
 }
 
+int class_register(struct class * cls)
+{
+	pr_debug("device class '%s': registering\n",cls->name);
+
+	INIT_LIST_HEAD(&cls->children);
+	INIT_LIST_HEAD(&cls->interfaces);
+	
+	strncpy(cls->subsys.kset.kobj.name,cls->name,KOBJ_NAME_LEN);
+	subsys_set_kset(cls,class_subsys);
+	subsystem_register(&cls->subsys);
 
-int devclass_create_file(struct device_class * cls, struct devclass_attribute * attr)
+	return 0;
+}
+
+void class_unregister(struct class * cls)
 {
-	int error;
-	if (cls) {
-		error = sysfs_create_file(&cls->subsys.kset.kobj,&attr->attr);
-	} else
-		error = -EINVAL;
+	pr_debug("device class '%s': unregistering\n",cls->name);
+	subsystem_unregister(&cls->subsys);
+}
+
+/* Class Device Stuff */
+
+int class_device_create_file(struct class_device * class_dev,
+			     struct class_device_attribute * attr)
+{
+	int error = -EINVAL;
+	if (class_dev)
+		error = sysfs_create_file(&class_dev->kobj, &attr->attr);
 	return error;
 }
 
-void devclass_remove_file(struct device_class * cls, struct devclass_attribute * attr)
+void class_device_remove_file(struct class_device * class_dev,
+			      struct class_device_attribute * attr)
 {
-	if (cls)
-		sysfs_remove_file(&cls->subsys.kset.kobj,&attr->attr);
+	if (class_dev)
+		sysfs_remove_file(&class_dev->kobj, &attr->attr);
 }
 
+static int class_device_dev_link(struct class_device * class_dev)
+{
+	if (class_dev->dev)
+		return sysfs_create_link(&class_dev->kobj,
+					 &class_dev->dev->kobj, "device");
+	return 0;
+}
 
-int devclass_add_driver(struct device_driver * drv)
+static void class_device_dev_unlink(struct class_device * class_dev)
 {
-	struct device_class * cls = get_devclass(drv->devclass);
-	int error = 0;
+	if (class_dev->dev)
+		sysfs_remove_link(&class_dev->kobj, "device");
+}
 
-	if (cls) {
-		down_write(&cls->subsys.rwsem);
-		pr_debug("device class %s: adding driver %s:%s\n",
-			 cls->name,drv->bus->name,drv->name);
-		error = devclass_drv_link(drv);
-		
-		if (!error)
-			list_add_tail(&drv->class_list,&cls->drivers.list);
-		up_write(&cls->subsys.rwsem);
-	}
-	return error;
+#define to_class_dev(obj) container_of(obj,struct class_device,kobj)
+#define to_class_dev_attr(_attr) container_of(_attr,struct class_device_attribute,attr)
+
+static ssize_t
+class_device_attr_show(struct kobject * kobj, struct attribute * attr,
+		       char * buf)
+{
+	struct class_device_attribute * class_dev_attr = to_class_dev_attr(attr);
+	struct class_device * cd = to_class_dev(kobj);
+	ssize_t ret = 0;
+
+	if (class_dev_attr->show)
+		ret = class_dev_attr->show(cd,buf);
+	return ret;
 }
 
-void devclass_remove_driver(struct device_driver * drv)
+static ssize_t
+class_device_attr_store(struct kobject * kobj, struct attribute * attr, 
+			const char * buf, size_t count)
 {
-	struct device_class * cls = drv->devclass;
-	if (cls) {
-		down_write(&cls->subsys.rwsem);
-		pr_debug("device class %s: removing driver %s:%s\n",
-			 cls->name,drv->bus->name,drv->name);
-		list_del_init(&drv->class_list);
-		devclass_drv_unlink(drv);
-		up_write(&cls->subsys.rwsem);
-		put_devclass(cls);
-	}
+	struct class_device_attribute * class_dev_attr = to_class_dev_attr(attr);
+	struct class_device * cd = to_class_dev(kobj);
+	ssize_t ret = 0;
+
+	if (class_dev_attr->store)
+		ret = class_dev_attr->store(cd,buf,count);
+	return ret;
 }
 
+static struct sysfs_ops class_dev_sysfs_ops = {
+	.show	= class_device_attr_show,
+	.store	= class_device_attr_store,
+};
 
-static void enum_device(struct device_class * cls, struct device * dev)
-{
-	u32 val;
-	val = cls->devnum++;
-	dev->class_num = val;
-	devclass_dev_link(cls,dev);
-}
-
-static void unenum_device(struct device_class * cls, struct device * dev)
-{
-	devclass_dev_unlink(cls,dev);
-	dev->class_num = 0;
-}
-
-/**
- *	devclass_add_device - register device with device class
- *	@dev:   device to be registered 
- *
- *	This is called when a device is either registered with the 
- *	core, or after the a driver module is loaded and bound to
- *	the device. 
- *	The class is determined by looking at @dev's driver, so one
- *	way or another, it must be bound to something. Once the 
- *	class is determined, it's set to prevent against concurrent
- *	calls for the same device stomping on each other. 
- *
- *	/sbin/hotplug should be called once the device is added to 
- *	class and all the interfaces. 
- */
-int devclass_add_device(struct device * dev)
+static struct kobj_type ktype_class_device = {
+	.sysfs_ops	= &class_dev_sysfs_ops,
+};
+
+static int class_hotplug_filter(struct kset *kset, struct kobject *kobj)
 {
-	struct device_class * cls;
-	int error = 0;
+	struct kobj_type *ktype = get_ktype(kobj);
 
-	down(&devclass_sem);
-	if (dev->driver) {
-		cls = get_devclass(dev->driver->devclass);
-
-		if (!cls)
-			goto Done;
-
-		pr_debug("device class %s: adding device %s\n",
-			 cls->name,dev->name);
-		if (cls->add_device) 
-			error = cls->add_device(dev);
-		if (error) {
-			put_devclass(cls);
-			goto Done;
-		}
+	if (ktype == &ktype_class_device) {
+		struct class_device *class_dev = to_class_dev(kobj);
+		if (class_dev->class)
+			return 1;
+	}
+	return 0;
+}
+
+static char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
+{
+	struct class_device *class_dev = to_class_dev(kobj);
 
-		down_write(&cls->subsys.rwsem);
-		enum_device(cls,dev);
-		list_add_tail(&dev->class_list,&cls->devices.list);
-		/* notify userspace (call /sbin/hotplug) */
-		class_hotplug (dev, "add");
+	return class_dev->class->name;
+}
 
-		up_write(&cls->subsys.rwsem);
+static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
+			 int num_envp, char *buffer, int buffer_size)
+{
+	struct class_device *class_dev = to_class_dev(kobj);
+	int retval = 0;
 
-		interface_add_dev(dev);
+	pr_debug("%s - name = %s\n", __FUNCTION__, class_dev->class_id);
+	if (class_dev->class->hotplug) {
+		/* have the bus specific function add its stuff */
+		retval = class_dev->class->hotplug (class_dev, envp, num_envp,
+						    buffer, buffer_size);
+			if (retval) {
+			pr_debug ("%s - hotplug() returned %d\n",
+				  __FUNCTION__, retval);
+		}
 	}
- Done:
-	up(&devclass_sem);
-	return error;
+
+	return retval;
 }
 
-void devclass_remove_device(struct device * dev)
+static struct kset_hotplug_ops class_hotplug_ops = {
+	.filter =	class_hotplug_filter,
+	.name =		class_hotplug_name,
+	.hotplug =	class_hotplug,
+};
+
+static decl_subsys(class_obj, &ktype_class_device, &class_hotplug_ops);
+
+void class_device_initialize(struct class_device *class_dev)
 {
-	struct device_class * cls;
+	kobject_init(&class_dev->kobj);
+	INIT_LIST_HEAD(&class_dev->node);
+}
 
-	down(&devclass_sem);
-	if (dev->driver) {
-		cls = dev->driver->devclass;
-		if (!cls) 
-			goto Done;
+int class_device_add(struct class_device *class_dev)
+{
+	struct class * parent;
+	struct class_interface * class_intf;
+	struct list_head * entry;
+	int error;
 
-		interface_remove_dev(dev);
+	class_dev = class_device_get(class_dev);
+	if (!class_dev || !strlen(class_dev->class_id))
+		return -EINVAL;
+
+	parent = class_get(class_dev->class);
+	if (class_dev->dev)
+		get_device(class_dev->dev);
+
+	pr_debug("CLASS: registering class device: ID = '%s'\n",
+		 class_dev->class_id);
+
+	/* first, register with generic layer. */
+	strncpy(class_dev->kobj.name, class_dev->class_id, KOBJ_NAME_LEN);
+	kobj_set_kset_s(class_dev, class_subsys);
+	kobj_set_kset_s(class_dev, class_obj_subsys);
+	if (parent)
+		class_dev->kobj.parent = &parent->subsys.kset.kobj;
+
+	if ((error = kobject_add(&class_dev->kobj)))
+		goto register_done;
+
+	/* now take care of our own registration */
+	if (parent) {
+		down_write(&parent->subsys.rwsem);
+		list_add_tail(&class_dev->node, &parent->children);
+		list_for_each(entry, &parent->interfaces) {
+			class_intf = container_of(entry, struct class_interface, node);
+			if (class_intf->add)
+				class_intf->add(class_dev);
+		}
+		up_write(&parent->subsys.rwsem);
+	}
 
-		down_write(&cls->subsys.rwsem);
-		pr_debug("device class %s: removing device %s\n",
-			 cls->name,dev->name);
+	class_device_dev_link(class_dev);
 
-		unenum_device(cls,dev);
+ register_done:
+	if (error && parent)
+		class_put(parent);
+	class_device_put(class_dev);
+	return error;
+}
 
-		list_del(&dev->class_list);
+int class_device_register(struct class_device *class_dev)
+{
+	class_device_initialize(class_dev);
+	return class_device_add(class_dev);
+}
 
-		/* notify userspace (call /sbin/hotplug) */
-		class_hotplug (dev, "remove");
+void class_device_del(struct class_device *class_dev)
+{
+	struct class * parent = class_dev->class;
+	struct class_interface * class_intf;
+	struct list_head * entry;
 
-		up_write(&cls->subsys.rwsem);
+	if (parent) {
+		down_write(&parent->subsys.rwsem);
+		list_del_init(&class_dev->node);
+		list_for_each(entry, &parent->interfaces) {
+			class_intf = container_of(entry, struct class_interface, node);
+			if (class_intf->remove)
+				class_intf->remove(class_dev);
+		}
+		up_write(&parent->subsys.rwsem);
+	}
 
-		if (cls->remove_device)
-			cls->remove_device(dev);
-		put_devclass(cls);
+	if (class_dev->dev) {
+		class_device_dev_unlink(class_dev);
+		put_device(class_dev->dev);
 	}
- Done:
-	up(&devclass_sem);
+	
+	kobject_del(&class_dev->kobj);
+
+	if (parent)
+		class_put(parent);
 }
 
-struct device_class * get_devclass(struct device_class * cls)
+void class_device_unregister(struct class_device *class_dev)
 {
-	return cls ? container_of(subsys_get(&cls->subsys),struct device_class,subsys) : NULL;
+	pr_debug("CLASS: Unregistering class device. ID = '%s'\n",
+		 class_dev->class_id);
+	class_device_del(class_dev);
+	class_device_put(class_dev);
 }
 
-void put_devclass(struct device_class * cls)
+struct class_device * class_device_get(struct class_device *class_dev)
 {
-	subsys_put(&cls->subsys);
+	if (class_dev)
+		return to_class_dev(kobject_get(&class_dev->kobj));
+	return NULL;
+}
+
+void class_device_put(struct class_device *class_dev)
+{
+	kobject_put(&class_dev->kobj);
 }
 
 
-int devclass_register(struct device_class * cls)
+int class_interface_register(struct class_interface *class_intf)
 {
-	pr_debug("device class '%s': registering\n",cls->name);
-	strncpy(cls->subsys.kset.kobj.name,cls->name,KOBJ_NAME_LEN);
-	subsys_set_kset(cls,class_subsys);
-	subsystem_register(&cls->subsys);
+	struct class * parent;
+	struct class_device * class_dev;
+	struct list_head * entry;
+
+	if (!class_intf || !class_intf->class)
+		return -ENODEV;
 
-	snprintf(cls->devices.kobj.name,KOBJ_NAME_LEN,"devices");
-	cls->devices.subsys = &cls->subsys;
-	kset_register(&cls->devices);
-
-	snprintf(cls->drivers.kobj.name,KOBJ_NAME_LEN,"drivers");
-	cls->drivers.subsys = &cls->subsys;
-	kset_register(&cls->drivers);
+	parent = class_get(class_intf->class);
+	if (!parent)
+		return -EINVAL;
+
+	down_write(&parent->subsys.rwsem);
+	list_add_tail(&class_intf->node, &parent->interfaces);
+
+	if (class_intf->add) {
+		list_for_each(entry, &parent->children) {
+			class_dev = container_of(entry, struct class_device, node);
+			class_intf->add(class_dev);
+		}
+	}
+	up_write(&parent->subsys.rwsem);
 
 	return 0;
 }
 
-void devclass_unregister(struct device_class * cls)
+void class_interface_unregister(struct class_interface *class_intf)
 {
-	pr_debug("device class '%s': unregistering\n",cls->name);
-	kset_unregister(&cls->drivers);
-	kset_unregister(&cls->devices);
-	subsystem_unregister(&cls->subsys);
+	struct class * parent = class_intf->class;
+	struct list_head * entry;
+
+	if (!parent)
+		return;
+
+	down_write(&parent->subsys.rwsem);
+	list_del_init(&class_intf->node);
+
+	if (class_intf->remove) {
+		list_for_each(entry, &parent->children) {
+			struct class_device *class_dev = container_of(entry, struct class_device, node);
+			class_intf->remove(class_dev);
+		}
+	}
+	up_write(&parent->subsys.rwsem);
+
+	class_put(parent);
 }
 
+
+
 int __init classes_init(void)
 {
-	return subsystem_register(&class_subsys);
+	int retval;
+
+	retval = subsystem_register(&class_subsys);
+	if (retval)
+		return retval;
+
+	/* ick, this is ugly, the things we go through to keep from showing up
+	 * in sysfs... */
+	subsystem_init(&class_obj_subsys);
+	if (!class_obj_subsys.kset.subsys)
+			class_obj_subsys.kset.subsys = &class_obj_subsys;
+	return 0;
 }
 
-EXPORT_SYMBOL(devclass_create_file);
-EXPORT_SYMBOL(devclass_remove_file);
-EXPORT_SYMBOL(devclass_register);
-EXPORT_SYMBOL(devclass_unregister);
-EXPORT_SYMBOL(get_devclass);
-EXPORT_SYMBOL(put_devclass);
+EXPORT_SYMBOL(class_create_file);
+EXPORT_SYMBOL(class_remove_file);
+EXPORT_SYMBOL(class_register);
+EXPORT_SYMBOL(class_unregister);
+EXPORT_SYMBOL(class_get);
+EXPORT_SYMBOL(class_put);
+
+EXPORT_SYMBOL(class_device_register);
+EXPORT_SYMBOL(class_device_unregister);
+EXPORT_SYMBOL(class_device_initialize);
+EXPORT_SYMBOL(class_device_add);
+EXPORT_SYMBOL(class_device_del);
+EXPORT_SYMBOL(class_device_get);
+EXPORT_SYMBOL(class_device_put);
+EXPORT_SYMBOL(class_device_create_file);
+EXPORT_SYMBOL(class_device_remove_file);
 
+EXPORT_SYMBOL(class_interface_register);
+EXPORT_SYMBOL(class_interface_unregister);
diff -urN linux-2.5.68-bk9/drivers/base/core.c linux-2.5.68-bk10/drivers/base/core.c
--- linux-2.5.68-bk9/drivers/base/core.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/core.c	2003-04-30 04:34:54.000000000 -0700
@@ -185,7 +185,6 @@
 	INIT_LIST_HEAD(&dev->children);
 	INIT_LIST_HEAD(&dev->driver_list);
 	INIT_LIST_HEAD(&dev->bus_list);
-	INIT_LIST_HEAD(&dev->class_list);
 }
 
 /**
@@ -235,7 +234,6 @@
 	if (platform_notify)
 		platform_notify(dev);
 
-	devclass_add_device(dev);
  register_done:
 	if (error && parent)
 		put_device(parent);
diff -urN linux-2.5.68-bk9/drivers/base/cpu.c linux-2.5.68-bk10/drivers/base/cpu.c
--- linux-2.5.68-bk9/drivers/base/cpu.c	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/cpu.c	2003-04-30 04:34:54.000000000 -0700
@@ -10,23 +10,16 @@
 #include <asm/topology.h>
 
 
-static int cpu_add_device(struct device * dev)
-{
-	return 0;
-}
-struct device_class cpu_devclass = {
+struct class cpu_class = {
 	.name		= "cpu",
-	.add_device	= cpu_add_device,
 };
 
 
 struct device_driver cpu_driver = {
 	.name		= "cpu",
 	.bus		= &system_bus_type,
-	.devclass	= &cpu_devclass,
 };
 
-
 /*
  * register_cpu - Setup a driverfs device for a CPU.
  * @num - CPU number to use when creating the device.
@@ -35,6 +28,8 @@
  */
 int __init register_cpu(struct cpu *cpu, int num, struct node *root)
 {
+	int retval;
+
 	cpu->node_id = cpu_to_node(num);
 	cpu->sysdev.name = "cpu";
 	cpu->sysdev.id = num;
@@ -42,7 +37,19 @@
 		cpu->sysdev.root = &root->sysroot;
 	snprintf(cpu->sysdev.dev.name, DEVICE_NAME_SIZE, "CPU %u", num);
 	cpu->sysdev.dev.driver = &cpu_driver;
-	return sys_device_register(&cpu->sysdev);
+	retval = sys_device_register(&cpu->sysdev);
+	if (retval)
+		return retval;
+	memset(&cpu->sysdev.class_dev, 0x00, sizeof(struct class_device));
+	cpu->sysdev.class_dev.dev = &cpu->sysdev.dev;
+	cpu->sysdev.class_dev.class = &cpu_class;
+	snprintf(cpu->sysdev.class_dev.class_id, BUS_ID_SIZE, "cpu%d", num);
+	retval = class_device_register(&cpu->sysdev.class_dev);
+	if (retval) {
+		// FIXME cleanup sys_device_register
+		return retval;
+	}
+	return 0;
 }
 
 
@@ -50,11 +57,11 @@
 {
 	int error;
 
-	error = devclass_register(&cpu_devclass);
+	error = class_register(&cpu_class);
 	if (!error) {
 		error = driver_register(&cpu_driver);
 		if (error)
-			devclass_unregister(&cpu_devclass);
+			class_unregister(&cpu_class);
 	}
 	return error;
 }
diff -urN linux-2.5.68-bk9/drivers/base/driver.c linux-2.5.68-bk10/drivers/base/driver.c
--- linux-2.5.68-bk9/drivers/base/driver.c	2003-04-19 19:50:44.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/driver.c	2003-04-30 04:34:54.000000000 -0700
@@ -82,7 +82,6 @@
 int driver_register(struct device_driver * drv)
 {
 	INIT_LIST_HEAD(&drv->devices);
-	INIT_LIST_HEAD(&drv->class_list);
 	init_MUTEX_LOCKED(&drv->unload_sem);
 	return bus_add_driver(drv);
 }
diff -urN linux-2.5.68-bk9/drivers/base/fs/Makefile linux-2.5.68-bk10/drivers/base/fs/Makefile
--- linux-2.5.68-bk9/drivers/base/fs/Makefile	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/fs/Makefile	1969-12-31 16:00:00.000000000 -0800
@@ -1,2 +0,0 @@
-obj-y		:= device.o
-
diff -urN linux-2.5.68-bk9/drivers/base/fs/device.c linux-2.5.68-bk10/drivers/base/fs/device.c
--- linux-2.5.68-bk9/drivers/base/fs/device.c	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/fs/device.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,49 +0,0 @@
-/*
- * drivers/base/fs.c - driver model interface to driverfs 
- *
- * Copyright (c) 2002 Patrick Mochel
- *		 2002 Open Source Development Lab
- */
-
-#undef DEBUG
-
-#include <linux/device.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/init.h>
-#include <linux/slab.h>
-#include <linux/err.h>
-#include <linux/stat.h>
-#include <linux/limits.h>
-
-int get_devpath_length(struct device * dev)
-{
-	int length = 1;
-	struct device * parent = dev;
-
-	/* walk up the ancestors until we hit the root.
-	 * Add 1 to strlen for leading '/' of each level.
-	 */
-	do {
-		length += strlen(parent->bus_id) + 1;
-		parent = parent->parent;
-	} while (parent);
-	return length;
-}
-
-void fill_devpath(struct device * dev, char * path, int length)
-{
-	struct device * parent;
-	--length;
-	for (parent = dev; parent; parent = parent->parent) {
-		int cur = strlen(parent->bus_id);
-
-		/* back up enough to print this bus id with '/' */
-		length -= cur;
-		strncpy(path + length,parent->bus_id,cur);
-		*(path + --length) = '/';
-	}
-
-	pr_debug("%s: path = '%s'\n",__FUNCTION__,path);
-}
-
diff -urN linux-2.5.68-bk9/drivers/base/fs/fs.h linux-2.5.68-bk10/drivers/base/fs/fs.h
--- linux-2.5.68-bk9/drivers/base/fs/fs.h	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/fs/fs.h	1969-12-31 16:00:00.000000000 -0800
@@ -1,5 +0,0 @@
-
-int get_devpath_length(struct device * dev);
-
-void fill_devpath(struct device * dev, char * path, int length);
-
diff -urN linux-2.5.68-bk9/drivers/base/hotplug.c linux-2.5.68-bk10/drivers/base/hotplug.c
--- linux-2.5.68-bk9/drivers/base/hotplug.c	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/hotplug.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,145 +0,0 @@
-/*
- * drivers/base/hotplug.c - hotplug call code
- * 
- * Copyright (c) 2000-2001 David Brownell
- * Copyright (c) 2002-2003 Greg Kroah-Hartman
- * Copyright (c) 2002-2003 IBM Corp.
- *
- * Based off of drivers/usb/core/usb.c:call_agent(), which was 
- * written by David Brownell.
- *
- */
-
-#undef DEBUG
-
-#include <linux/device.h>
-#include <linux/slab.h>
-#include <linux/err.h>
-#include <linux/kmod.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/string.h>
-#include "base.h"
-#include "fs/fs.h"
-
-/*
- * hotplugging invokes what /proc/sys/kernel/hotplug says (normally
- * /sbin/hotplug) when devices or classes get added or removed.
- *
- * This invokes a user mode policy agent, typically helping to load driver
- * or other modules, configure the device, and more.  Drivers can provide
- * a MODULE_DEVICE_TABLE to help with module loading subtasks.
- *
- * See the documentation at http://linux-hotplug.sf.net for more info.
- * 
- */
-
-#define BUFFER_SIZE	1024	/* should be enough memory for the env */
-#define NUM_ENVP	32	/* number of env pointers */
-
-static char prefix [] = "devices";	/* /sys/devices/... */
-
-static int do_hotplug (struct device *dev, char *argv1, const char *action,
-			int (* hotplug) (struct device *, char **, int, char *, int))
-{
-	char *argv [3], **envp, *buffer, *scratch;
-	char *dev_path;
-	int retval;
-	int i = 0;
-	int dev_length;
-
-	pr_debug ("%s\n", __FUNCTION__);
-
-	if (!hotplug_path [0])
-		return -ENODEV;
-
-	envp = (char **) kmalloc (NUM_ENVP * sizeof (char *), GFP_KERNEL);
-	if (!envp)
-		return -ENOMEM;
-	memset (envp, 0x00, NUM_ENVP * sizeof (char *));
-
-	buffer = kmalloc (BUFFER_SIZE, GFP_KERNEL);
-	if (!buffer) {
-		kfree (envp);
-		return -ENOMEM;
-	}
-
-	dev_length = get_devpath_length (dev);
-	dev_length += strlen(prefix);
-	dev_path = kmalloc (dev_length, GFP_KERNEL);
-	if (!dev_path) {
-		kfree (buffer);
-		kfree (envp);
-		return -ENOMEM;
-	}
-	memset (dev_path, 0x00, dev_length);
-	strcpy (dev_path, prefix);
-	fill_devpath (dev, dev_path, dev_length);
-
-	argv [0] = hotplug_path;
-	argv [1] = argv1;
-	argv [2] = 0;
-
-	/* minimal command environment */
-	envp [i++] = "HOME=/";
-	envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
-
-	scratch = buffer;
-
-	envp [i++] = scratch;
-	scratch += sprintf (scratch, "ACTION=%s", action) + 1;
-
-	envp [i++] = scratch;
-	scratch += sprintf (scratch, "DEVPATH=%s", dev_path) + 1;
-	
-	if (hotplug) {
-		/* have the bus specific function add its stuff */
-		retval = hotplug (dev, &envp[i], NUM_ENVP - i, scratch,
-				  BUFFER_SIZE - (scratch - buffer));
-		if (retval) {
-			pr_debug ("%s - hotplug() returned %d\n",
-				  __FUNCTION__, retval);
-			goto exit;
-		}
-	}
-
-	pr_debug ("%s: %s %s %s %s %s %s\n", __FUNCTION__, argv [0], argv[1],
-		  envp[0], envp[1], envp[2], envp[3]);
-	retval = call_usermodehelper (argv [0], argv, envp, 0);
-	if (retval)
-		pr_debug ("%s - call_usermodehelper returned %d\n",
-			  __FUNCTION__, retval);
-
-exit:
-	kfree (dev_path);
-	kfree (buffer);
-	kfree (envp);
-	return retval;
-}
-
-/*
- * class_hotplug - called when a class is added or removed from a device
- */
-int class_hotplug (struct device *dev, const char *action)
-{
-	struct device_class * cls;
-	int retval;
-
-	pr_debug ("%s\n", __FUNCTION__);
-
-	if (!dev)
-		return -ENODEV;
-
-	if (!dev->bus)
-		return -ENODEV;
-
-	cls = get_devclass(dev->driver->devclass);
-	if (!cls)
-		return -ENODEV;
-
-	retval = do_hotplug (dev, cls->name, action, cls->hotplug);
-
-	put_devclass(cls);
-
-	return retval;
-}
diff -urN linux-2.5.68-bk9/drivers/base/intf.c linux-2.5.68-bk10/drivers/base/intf.c
--- linux-2.5.68-bk9/drivers/base/intf.c	2003-04-19 19:50:43.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/intf.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,225 +0,0 @@
-/*
- * intf.c - class-specific interface management
- */
-
-#undef DEBUG
-
-#include <linux/device.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include "base.h"
-
-
-#define to_intf(node) container_of(node,struct device_interface,kset.kobj.entry)
-
-#define to_dev(d) container_of(d,struct device,class_list)
-
-/**
- *	intf_dev_link - create sysfs symlink for interface.
- *	@intf:	interface.
- *	@dev:	device.
- *
- *	Create a symlink 'phys' in the interface's directory to 
- */
-
-static int intf_dev_link(struct device_interface * intf, struct device * dev)
-{
-	return sysfs_create_link(&intf->kset.kobj,&dev->kobj,dev->bus_id);
-}
-
-/**
- *	intf_dev_unlink - remove symlink for interface.
- *	@intf:	interface.
- *	@dev:	device.
- *
- */
-
-static void intf_dev_unlink(struct device_interface * intf, struct device * dev)
-{
-	sysfs_remove_link(&intf->kset.kobj,dev->bus_id);
-}
-
-
-/**
- *	add - attach device to interface
- *	@intf:	interface.
- *	@dev:	device.
- *
- *	This is just a simple helper. Check the interface's interface
- *	helper and call it. This is called when adding an interface
- *	the class's devices, or a device to the class's interfaces.
- */
-
-static int add(struct device_interface * intf, struct device * dev)
-{
-	int error = 0;
-
-	if (intf->add_device) {
-		if (!(error = intf->add_device(dev)))
-			intf_dev_link(intf,dev);
-	}
-	pr_debug(" -> %s (%d)\n",dev->bus_id,error);
-	return error;
-}
-
-/**
- *	del - detach device from interface.
- *	@intf:	interface.
- *	@dev:	device.
- */
-
-static void del(struct device_interface * intf, struct device * dev)
-{
-	pr_debug(" -> %s ",intf->name);
-	if (intf->remove_device)
-		intf->remove_device(dev);
-	intf_dev_unlink(intf,dev);
-}
-
-
-/**
- *	add_intf - add class's devices to interface.
- *	@intf:	interface.
- *
- *	Loop over the devices registered with the class, and call
- *	the interface's add_device() method for each.
- *
- *	On an error, we won't break, but we will print debugging info.
- */
-static void add_intf(struct device_interface * intf)
-{
-	struct device_class * cls = intf->devclass;
-	struct list_head * entry;
-
-	list_for_each(entry,&cls->devices.list)
-		add(intf,to_dev(entry));
-}
-
-/**
- *	interface_register - register an interface with a device class.
- *	@intf:	interface.
- *
- *	An interface may be loaded after drivers and devices have been
- *	added to the class. So, we must add each device already known to
- *	the class to the interface as its registered.
- */
-
-int interface_register(struct device_interface * intf)
-{
-	struct device_class * cls = get_devclass(intf->devclass);
-
-	down(&devclass_sem);
-	if (cls) {
-		pr_debug("register interface '%s' with class '%s'\n",
-			 intf->name,cls->name);
-
-		strncpy(intf->kset.kobj.name,intf->name,KOBJ_NAME_LEN);
-		kset_set_kset_s(intf,cls->subsys);
-		kset_register(&intf->kset);
-		add_intf(intf);
-	}
-	up(&devclass_sem);
-	return 0;
-}
-
-
-/**
- *	del_intf - remove devices from interface.
- *	@intf:	interface being unloaded.
- *
- *	This loops over the devices registered with a class and 
- *	calls the interface's remove_device() method for each.
- *	This is called when an interface is being unregistered.
- */
-
-static void del_intf(struct device_interface * intf)
-{
-	struct device_class * cls = intf->devclass;
-	struct list_head * entry;
-
-	list_for_each(entry,&cls->devices.list) {
-		struct device * dev = to_dev(entry);
-		del(intf,dev);
-	}
-}
-
-/**
- *	interface_unregister - remove interface from class.
- *	@intf:	interface.
- *
- *	This is called when an interface in unloaded, giving it a
- *	chance to remove itself from devicse that have been added to 
- *	it.
- */
-
-void interface_unregister(struct device_interface * intf)
-{
-	struct device_class * cls = intf->devclass;
-
-	down(&devclass_sem);
-	if (cls) {
-		pr_debug("unregistering interface '%s' from class '%s'\n",
-			 intf->name,cls->name);
-		del_intf(intf);
-		kset_unregister(&intf->kset);
-		put_devclass(cls);
-	}
-	up(&devclass_sem);
-}
-
-
-/**
- *	interface_add_dev - add device to interfaces.
- *	@dev:	device.
- *
- *	This is a helper for the class driver core. When a 
- *	device is being added to a class, this is called to add
- *	the device to all the interfaces in the class.
- *
- *	The operation is simple enough: loop over the interfaces
- *	and call add() [above] for each. The class rwsem is assumed
- *	to be held.
- */
-
-int interface_add_dev(struct device * dev)
-{
-	struct device_class * cls = dev->driver->devclass;
-	struct list_head * node;
-
-	pr_debug("interfaces: adding device %s\n",dev->name);
-
-	list_for_each(node,&cls->subsys.kset.list) {
-		struct device_interface * intf = to_intf(node);
-		add(intf,dev);
-	}
-	return 0;
-}
-
-
-/**
- *	interface_remove_dev - remove device from interfaces.
- *	@dev:	device.
- *
- *	This is another helper for the class driver core, and called
- *	when the device is being removed from the class. 
- *	
- *	We iterate over the list of the class's devices and call del() 
- *	[above] for each. Again, the class's rwsem is _not_ held, but
- *	the devclass_sem is (see class.c).
- */
-
-void interface_remove_dev(struct device * dev)
-{
-	struct list_head * entry, * next;
-	struct device_class * cls = dev->driver->devclass;
-
-	pr_debug("interfaces: removing device %s\n",dev->name);
-
-	list_for_each_safe(entry,next,&cls->subsys.kset.list) {
-		struct device_interface * intf = to_intf(entry);
-		del(intf,dev);
-	}
-}
-
-EXPORT_SYMBOL(interface_register);
-EXPORT_SYMBOL(interface_unregister);
diff -urN linux-2.5.68-bk9/drivers/base/memblk.c linux-2.5.68-bk10/drivers/base/memblk.c
--- linux-2.5.68-bk9/drivers/base/memblk.c	2003-04-19 19:51:16.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/memblk.c	2003-04-30 04:34:54.000000000 -0700
@@ -11,20 +11,14 @@
 #include <asm/topology.h>
 
 
-static int memblk_add_device(struct device * dev)
-{
-	return 0;
-}
-struct device_class memblk_devclass = {
+static struct class memblk_class = {
 	.name		= "memblk",
-	.add_device	= memblk_add_device,
 };
 
 
-struct device_driver memblk_driver = {
+static struct device_driver memblk_driver = {
 	.name		= "memblk",
 	.bus		= &system_bus_type,
-	.devclass	= &memblk_devclass,
 };
 
 
@@ -51,11 +45,11 @@
 {
 	int error;
 
-	error = devclass_register(&memblk_devclass);
+	error = class_register(&memblk_class);
 	if (!error) {
 		error = driver_register(&memblk_driver);
 		if (error)
-			devclass_unregister(&memblk_devclass);
+			class_unregister(&memblk_class);
 	}
 	return error;
 }
diff -urN linux-2.5.68-bk9/drivers/base/node.c linux-2.5.68-bk10/drivers/base/node.c
--- linux-2.5.68-bk9/drivers/base/node.c	2003-04-19 19:48:52.000000000 -0700
+++ linux-2.5.68-bk10/drivers/base/node.c	2003-04-30 04:34:54.000000000 -0700
@@ -11,20 +11,14 @@
 #include <asm/topology.h>
 
 
-static int node_add_device(struct device * dev)
-{
-	return 0;
-}
-struct device_class node_devclass = {
+static struct class node_class = {
 	.name		= "node",
-	.add_device	= node_add_device,
 };
 
 
-struct device_driver node_driver = {
+static struct device_driver node_driver = {
 	.name		= "node",
 	.bus		= &system_bus_type,
-	.devclass	= &node_devclass,
 };
 
 
@@ -93,11 +87,11 @@
 {
 	int error;
 	
-	error = devclass_register(&node_devclass);
+	error = class_register(&node_class);
 	if (!error) {
 		error = driver_register(&node_driver);
 		if (error)
-			devclass_unregister(&node_devclass);
+			class_unregister(&node_class);
 	}
 	return error;
 }
diff -urN linux-2.5.68-bk9/drivers/bluetooth/bluecard_cs.c linux-2.5.68-bk10/drivers/bluetooth/bluecard_cs.c
--- linux-2.5.68-bk9/drivers/bluetooth/bluecard_cs.c	2003-04-30 04:34:48.000000000 -0700
+++ linux-2.5.68-bk10/drivers/bluetooth/bluecard_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -822,19 +822,6 @@
 	return 0;
 }
 
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-
-	CardServices(ReportError, handle, &err);
-}
-
-
 dev_link_t *bluecard_attach(void)
 {
 	bluecard_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/bluetooth/bt3c_cs.c linux-2.5.68-bk10/drivers/bluetooth/bt3c_cs.c
--- linux-2.5.68-bk9/drivers/bluetooth/bt3c_cs.c	2003-04-30 04:34:48.000000000 -0700
+++ linux-2.5.68-bk10/drivers/bluetooth/bt3c_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -569,19 +569,6 @@
 	return 0;
 }
 
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-
-	CardServices(ReportError, handle, &err);
-}
-
-
 dev_link_t *bt3c_attach(void)
 {
 	bt3c_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/bluetooth/btuart_cs.c linux-2.5.68-bk10/drivers/bluetooth/btuart_cs.c
--- linux-2.5.68-bk9/drivers/bluetooth/btuart_cs.c	2003-04-30 04:34:48.000000000 -0700
+++ linux-2.5.68-bk10/drivers/bluetooth/btuart_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -576,19 +576,6 @@
 	return 0;
 }
 
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-
-	CardServices(ReportError, handle, &err);
-}
-
-
 dev_link_t *btuart_attach(void)
 {
 	btuart_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/bluetooth/dtl1_cs.c linux-2.5.68-bk10/drivers/bluetooth/dtl1_cs.c
--- linux-2.5.68-bk9/drivers/bluetooth/dtl1_cs.c	2003-04-30 04:34:48.000000000 -0700
+++ linux-2.5.68-bk10/drivers/bluetooth/dtl1_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -555,19 +555,6 @@
 	return 0;
 }
 
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-
-	CardServices(ReportError, handle, &err);
-}
-
-
 dev_link_t *dtl1_attach(void)
 {
 	dtl1_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/char/pcmcia/synclink_cs.c linux-2.5.68-bk10/drivers/char/pcmcia/synclink_cs.c
--- linux-2.5.68-bk9/drivers/char/pcmcia/synclink_cs.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/char/pcmcia/synclink_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -527,12 +527,6 @@
 static dev_info_t dev_info = "synclink_cs";
 static dev_link_t *dev_list = NULL;
 
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*
  * 1st function defined in .text section. Calling this function in
  * init_module() followed by a breakpoint allows a remote debugger
diff -urN linux-2.5.68-bk9/drivers/char/tty_io.c linux-2.5.68-bk10/drivers/char/tty_io.c
--- linux-2.5.68-bk9/drivers/char/tty_io.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/char/tty_io.c	2003-04-30 04:34:54.000000000 -0700
@@ -2288,17 +2288,16 @@
 extern int vty_init(void);
 #endif
 
-struct device_class tty_devclass = {
+static struct class tty_class = {
 	.name	= "tty",
 };
-EXPORT_SYMBOL(tty_devclass);
 
-static int __init tty_devclass_init(void)
+static int __init tty_class_init(void)
 {
-	return devclass_register(&tty_devclass);
+	return class_register(&tty_class);
 }
 
-postcore_initcall(tty_devclass_init);
+postcore_initcall(tty_class_init);
 
 /*
  * Ok, now we can initialize the rest of the tty devices and can count
diff -urN linux-2.5.68-bk9/drivers/ide/legacy/ide-cs.c linux-2.5.68-bk10/drivers/ide/legacy/ide-cs.c
--- linux-2.5.68-bk9/drivers/ide/legacy/ide-cs.c	2003-04-19 19:50:10.000000000 -0700
+++ linux-2.5.68-bk10/drivers/ide/legacy/ide-cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -103,14 +103,6 @@
 
 static dev_link_t *dev_list = NULL;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     ide_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/input/evbug.c linux-2.5.68-bk10/drivers/input/evbug.c
--- linux-2.5.68-bk9/drivers/input/evbug.c	2003-04-19 19:49:19.000000000 -0700
+++ linux-2.5.68-bk10/drivers/input/evbug.c	2003-04-30 04:34:54.000000000 -0700
@@ -88,19 +88,8 @@
 	.id_table =	evbug_ids,
 };
 
-static struct device_interface evbug_intf = {
-	.name		= "debug",
-	.devclass	= &input_devclass,
-};
-
 int __init evbug_init(void)
 {
-	int retval;
-
-	retval = interface_register(&evbug_intf);
-	if(retval < 0)
-		return retval;
-
 	input_register_handler(&evbug_handler);
 	return 0;
 }
@@ -108,7 +97,6 @@
 void __exit evbug_exit(void)
 {
 	input_unregister_handler(&evbug_handler);
-	interface_unregister(&evbug_intf);
 }
 
 module_init(evbug_init);
diff -urN linux-2.5.68-bk9/drivers/input/evdev.c linux-2.5.68-bk10/drivers/input/evdev.c
--- linux-2.5.68-bk9/drivers/input/evdev.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/input/evdev.c	2003-04-30 04:34:54.000000000 -0700
@@ -435,19 +435,8 @@
 	.id_table =	evdev_ids,
 };
 
-static struct device_interface evdev_intf = {
-	.name		= "event",
-	.devclass	= &input_devclass,
-};
-
 static int __init evdev_init(void)
 {
-	int retval;
-
-	retval = interface_register(&evdev_intf);
-	if(retval < 0)
-		return retval;
-
 	input_register_handler(&evdev_handler);
 	return 0;
 }
@@ -455,7 +444,6 @@
 static void __exit evdev_exit(void)
 {
 	input_unregister_handler(&evdev_handler);
-	interface_unregister(&evdev_intf);
 }
 
 module_init(evdev_init);
diff -urN linux-2.5.68-bk9/drivers/input/input.c linux-2.5.68-bk10/drivers/input/input.c
--- linux-2.5.68-bk9/drivers/input/input.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/input/input.c	2003-04-30 04:34:54.000000000 -0700
@@ -38,7 +38,7 @@
 EXPORT_SYMBOL(input_accept_process);
 EXPORT_SYMBOL(input_flush_device);
 EXPORT_SYMBOL(input_event);
-EXPORT_SYMBOL(input_devclass);
+EXPORT_SYMBOL(input_class);
 
 #define INPUT_MAJOR	13
 #define INPUT_DEVICES	256
@@ -667,7 +667,7 @@
 
 #endif
 
-struct device_class input_devclass = {
+struct class input_class = {
 	.name		= "input",
 };
 
@@ -675,7 +675,7 @@
 {
 	struct proc_dir_entry *entry;
 
-	devclass_register(&input_devclass);
+	class_register(&input_class);
 
 #ifdef CONFIG_PROC_FS
 	proc_bus_input_dir = proc_mkdir("input", proc_bus);
@@ -705,7 +705,7 @@
 	devfs_remove("input");
         if (unregister_chrdev(INPUT_MAJOR, "input"))
                 printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
-	devclass_unregister(&input_devclass);
+	class_unregister(&input_class);
 }
 
 subsys_initcall(input_init);
diff -urN linux-2.5.68-bk9/drivers/input/joydev.c linux-2.5.68-bk10/drivers/input/joydev.c
--- linux-2.5.68-bk9/drivers/input/joydev.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/input/joydev.c	2003-04-30 04:34:54.000000000 -0700
@@ -493,19 +493,8 @@
 	.id_table =	joydev_ids,
 };
 
-static struct device_interface joydev_intf = {
-	.name		= "joystick",
-	.devclass	= &input_devclass,
-};
-
 static int __init joydev_init(void)
 {
-	int retval;
-
-	retval = interface_register(&joydev_intf);
-	if(retval < 0)
-		return retval;
-
 	input_register_handler(&joydev_handler);
 	return 0;
 }
@@ -513,7 +502,6 @@
 static void __exit joydev_exit(void)
 {
 	input_unregister_handler(&joydev_handler);
-	interface_unregister(&joydev_intf);
 }
 
 module_init(joydev_init);
diff -urN linux-2.5.68-bk9/drivers/input/mousedev.c linux-2.5.68-bk10/drivers/input/mousedev.c
--- linux-2.5.68-bk9/drivers/input/mousedev.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/input/mousedev.c	2003-04-30 04:34:54.000000000 -0700
@@ -492,18 +492,8 @@
 };
 #endif
 
-static struct device_interface mousedev_intf = {
-	.name		= "mouse",
-	.devclass	= &input_devclass,
-};
-
 static int __init mousedev_init(void)
 {
-	int retval;
-
-	if((retval = interface_register(&mousedev_intf)) < 0)
-		return retval;
-
 	input_register_handler(&mousedev_handler);
 
 	memset(&mousedev_mix, 0, sizeof(struct mousedev));
@@ -532,7 +522,6 @@
 #endif
 	devfs_remove("input/mice");
 	input_unregister_handler(&mousedev_handler);
-	interface_unregister(&mousedev_intf);
 }
 
 module_init(mousedev_init);
diff -urN linux-2.5.68-bk9/drivers/input/tsdev.c linux-2.5.68-bk10/drivers/input/tsdev.c
--- linux-2.5.68-bk9/drivers/input/tsdev.c	2003-04-30 04:34:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/input/tsdev.c	2003-04-30 04:34:54.000000000 -0700
@@ -378,19 +378,8 @@
 	.id_table =	tsdev_ids,
 };
 
-static struct device_interface tsdev_intf = {
-	.name		= "touchscreen",
-	.devclass	= &input_devclass,
-};
-
 static int __init tsdev_init(void)
 {
-	int retval;
-
-	retval = interface_register(&tsdev_intf);
-	if(retval < 0)
-		return retval;
-
 	input_register_handler(&tsdev_handler);
 	printk(KERN_INFO "ts: Compaq touchscreen protocol output\n");
 	return 0;
@@ -399,7 +388,6 @@
 static void __exit tsdev_exit(void)
 {
 	input_unregister_handler(&tsdev_handler);
-	interface_unregister(&tsdev_intf);
 }
 
 module_init(tsdev_init);
diff -urN linux-2.5.68-bk9/drivers/isdn/hardware/avm/avm_cs.c linux-2.5.68-bk10/drivers/isdn/hardware/avm/avm_cs.c
--- linux-2.5.68-bk9/drivers/isdn/hardware/avm/avm_cs.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk10/drivers/isdn/hardware/avm/avm_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -118,14 +118,6 @@
     dev_node_t	node;
 } local_info_t;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     avmcs_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/isdn/hisax/avma1_cs.c linux-2.5.68-bk10/drivers/isdn/hisax/avma1_cs.c
--- linux-2.5.68-bk9/drivers/isdn/hisax/avma1_cs.c	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk10/drivers/isdn/hisax/avma1_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -130,14 +130,6 @@
     dev_node_t	node;
 } local_info_t;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     avma1cs_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/isdn/hisax/elsa_cs.c linux-2.5.68-bk10/drivers/isdn/hisax/elsa_cs.c
--- linux-2.5.68-bk9/drivers/isdn/hisax/elsa_cs.c	2003-04-19 19:49:26.000000000 -0700
+++ linux-2.5.68-bk10/drivers/isdn/hisax/elsa_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -170,14 +170,6 @@
     int                 busy;
 } local_info_t;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret};
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     elsa_cs_attach() creates an "instance" of the driver, allocatingx
diff -urN linux-2.5.68-bk9/drivers/isdn/hisax/sedlbauer_cs.c linux-2.5.68-bk10/drivers/isdn/hisax/sedlbauer_cs.c
--- linux-2.5.68-bk9/drivers/isdn/hisax/sedlbauer_cs.c	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk10/drivers/isdn/hisax/sedlbauer_cs.c	2003-04-30 04:34:54.000000000 -0700
@@ -178,14 +178,6 @@
     int			stop;
 } local_info_t;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     sedlbauer_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/mtd/maps/pcmciamtd.c linux-2.5.68-bk10/drivers/mtd/maps/pcmciamtd.c
--- linux-2.5.68-bk9/drivers/mtd/maps/pcmciamtd.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk10/drivers/mtd/maps/pcmciamtd.c	2003-04-30 04:34:54.000000000 -0700
@@ -106,16 +106,7 @@
 MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)");
 
 
-
-static inline void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-}
-
-
 /* read/write{8,16} copy_{from,to} routines with window remapping to access whole card */
-
 static caddr_t remap_window(struct map_info *map, unsigned long to)
 {
 	struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/3c574_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/3c574_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/3c574_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/3c574_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -273,16 +273,6 @@
 	}
 }
 
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-#if CS_RELEASE_CODE < 0x2911
-	CardServices(ReportError, dev_info, (void *)func, (void *)ret);
-#else
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-#endif
-}
-
 /*
 	tc574_attach() creates an "instance" of the driver, allocating
 	local data structures for one device.  The device is registered
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/3c589_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/3c589_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/3c589_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/3c589_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -193,14 +193,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     tc589_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/axnet_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/axnet_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/axnet_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/axnet_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -157,14 +157,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     We never need to do anything when a axnet device is "initialized"
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/com20020_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/com20020_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/com20020_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/com20020_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -163,14 +163,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     com20020_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/fmvj18x_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/fmvj18x_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/fmvj18x_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/fmvj18x_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -261,16 +261,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
 static dev_link_t *fmvj18x_attach(void)
 {
     local_info_t *lp;
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/ibmtr_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/ibmtr_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/ibmtr_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/ibmtr_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -157,14 +157,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
 {
 	u32 ethcmd;
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/nmclan_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/nmclan_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/nmclan_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/nmclan_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -457,17 +457,6 @@
 }
 
 /* ----------------------------------------------------------------------------
-cs_error
-	Report a Card Services related error.
----------------------------------------------------------------------------- */
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
-/* ----------------------------------------------------------------------------
 nmclan_attach
 	Creates an "instance" of the driver, allocating local data
 	structures for one device.  The device is registered with Card
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/pcnet_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/pcnet_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/pcnet_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/pcnet_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -255,14 +255,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     We never need to do anything when a pcnet device is "initialized"
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/smc91c92_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/smc91c92_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/smc91c92_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/smc91c92_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -324,14 +324,6 @@
     }
 }
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
   smc91c92_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/net/pcmcia/xirc2ps_cs.c linux-2.5.68-bk10/drivers/net/pcmcia/xirc2ps_cs.c
--- linux-2.5.68-bk9/drivers/net/pcmcia/xirc2ps_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pcmcia/xirc2ps_cs.c	2003-04-30 04:34:55.000000000 -0700
@@ -403,13 +403,6 @@
     }
 }
 
-static void
-cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 static int
 get_tuple_data(int fn, client_handle_t handle, tuple_t *tuple)
 {
diff -urN linux-2.5.68-bk9/drivers/net/pppoe.c linux-2.5.68-bk10/drivers/net/pppoe.c
--- linux-2.5.68-bk9/drivers/net/pppoe.c	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pppoe.c	2003-04-30 04:34:55.000000000 -0700
@@ -471,16 +471,15 @@
 
 /***********************************************************************
  *
- * Really kill the socket. (Called from sock_put if refcnt == 0.)
+ * Really kill the socket. (Called from pppox_sk_free if refcnt == 0.)
  *
  **********************************************************************/
-void pppoe_sock_destruct(struct sock *sk)
+static void pppoe_sk_free(struct sock *sk)
 {
 	struct pppox_opt *po = pppox_sk(sk);
 
 	if (po)
 		kfree(po);
-	MOD_DEC_USE_COUNT;
 }
 
 
@@ -495,26 +494,16 @@
 	struct sock *sk;
 	struct pppox_opt *po;
 
-	MOD_INC_USE_COUNT;
-
-	sk = sk_alloc(PF_PPPOX, GFP_KERNEL, 1, NULL);
+	sk = pppox_sk_alloc(sock, PX_PROTO_OE, GFP_KERNEL, 1, NULL);
 	if (!sk)
-		goto decmod;
-
-	sock_init_data(sock, sk);
+		goto out;
 
 	sock->state = SS_UNCONNECTED;
 	sock->ops   = &pppoe_ops;
 
-	sk->protocol = PX_PROTO_OE;
-	sk->family = PF_PPPOX;
-
 	sk->backlog_rcv = pppoe_rcv_core;
-	sk->next = NULL;
-	sk->pprev = NULL;
 	sk->state = PPPOX_NONE;
 	sk->type = SOCK_STREAM;
-	sk->destruct = pppoe_sock_destruct;
 
 	po = pppox_sk(sk) = kmalloc(sizeof(*po), GFP_KERNEL);
 	if (!po)
@@ -522,10 +511,8 @@
 	memset(po, 0, sizeof(*po));
 	po->sk = sk;
 	error = 0;
-	sock->sk = sk;
 out:	return error;
 frees:	sk_free(sk);
-decmod:	MOD_DEC_USE_COUNT;
 	goto out;
 }
 
@@ -1075,16 +1062,16 @@
 };
 #endif /* CONFIG_PROC_FS */
 
+/* ->release and ->ioctl are set at pppox_create */
+
 struct proto_ops pppoe_ops = {
     .family		= AF_PPPOX,
-    .release		= pppoe_release,
     .bind		= sock_no_bind,
     .connect		= pppoe_connect,
     .socketpair		= sock_no_socketpair,
     .accept		= sock_no_accept,
     .getname		= pppoe_getname,
     .poll		= datagram_poll,
-    .ioctl		= pppoe_ioctl,
     .listen		= sock_no_listen,
     .shutdown		= sock_no_shutdown,
     .setsockopt		= sock_no_setsockopt,
@@ -1096,7 +1083,10 @@
 
 struct pppox_proto pppoe_proto = {
     .create	= pppoe_create,
-    .ioctl	= pppoe_ioctl
+    .ioctl	= pppoe_ioctl,
+    .release	= pppoe_release,
+    .sk_free	= pppoe_sk_free,
+    .owner	= THIS_MODULE,
 };
 
 
diff -urN linux-2.5.68-bk9/drivers/net/pppox.c linux-2.5.68-bk10/drivers/net/pppox.c
--- linux-2.5.68-bk9/drivers/net/pppox.c	2003-04-19 19:50:48.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/pppox.c	2003-04-30 04:34:55.000000000 -0700
@@ -36,22 +36,22 @@
 
 #include <asm/uaccess.h>
 
-static struct pppox_proto *proto[PX_MAX_PROTO+1];
+static struct pppox_proto *pppox_protos[PX_MAX_PROTO + 1];
 
 int register_pppox_proto(int proto_num, struct pppox_proto *pp)
 {
 	if (proto_num < 0 || proto_num > PX_MAX_PROTO)
 		return -EINVAL;
-	if (proto[proto_num])
+	if (pppox_protos[proto_num])
 		return -EALREADY;
-	proto[proto_num] = pp;
+	pppox_protos[proto_num] = pp;
 	return 0;
 }
 
 void unregister_pppox_proto(int proto_num)
 {
 	if (proto_num >= 0 && proto_num <= PX_MAX_PROTO)
-		proto[proto_num] = NULL;
+		pppox_protos[proto_num] = NULL;
 }
 
 void pppox_unbind_sock(struct sock *sk)
@@ -64,71 +64,112 @@
 	}
 }
 
+static int pppox_release(struct socket *sock)
+{
+	struct sock *sk = sock->sk;
+	int rc = pppox_protos[sk->protocol]->release(sock);
+
+	module_put(pppox_protos[sk->protocol]->owner);
+	return rc;
+}
+
+static void pppox_sk_free(struct sock *sk)
+{
+	pppox_protos[sk->protocol]->sk_free(sk);
+	module_put(pppox_protos[sk->protocol]->owner);
+}
+
+struct sock *pppox_sk_alloc(struct socket *sock, int protocol, int priority,
+			    int zero_it, kmem_cache_t *slab)
+{
+	struct sock *sk = NULL;
+
+	if (!try_module_get(pppox_protos[protocol]->owner))
+		goto out;
+
+	sk = sk_alloc(PF_PPPOX, priority, zero_it, slab);
+	if (sk) {
+		sock_init_data(sock, sk);
+		sk->family   = PF_PPPOX;
+		sk->protocol = protocol;
+		sk->destruct = pppox_sk_free;
+	} else
+		module_put(pppox_protos[protocol]->owner);
+out:
+	return sk;
+}
+
 EXPORT_SYMBOL(register_pppox_proto);
 EXPORT_SYMBOL(unregister_pppox_proto);
 EXPORT_SYMBOL(pppox_unbind_sock);
+EXPORT_SYMBOL(pppox_sk_alloc);
 
 static int pppox_ioctl(struct socket* sock, unsigned int cmd, 
 		       unsigned long arg)
 {
 	struct sock *sk = sock->sk;
 	struct pppox_opt *po = pppox_sk(sk);
-	int err = 0;
+	int rc = 0;
 
 	lock_sock(sk);
 
 	switch (cmd) {
-	case PPPIOCGCHAN:{
+	case PPPIOCGCHAN: {
 		int index;
-		err = -ENOTCONN;
+		rc = -ENOTCONN;
 		if (!(sk->state & PPPOX_CONNECTED))
 			break;
 
-		err = -EINVAL;
+		rc = -EINVAL;
 		index = ppp_channel_index(&po->chan);
 		if (put_user(index , (int *) arg))
 			break;
 
-		err = 0;
+		rc = 0;
 		sk->state |= PPPOX_BOUND;
 		break;
 	}
 	default:
-		if (proto[sk->protocol]->ioctl)
-			err = (*proto[sk->protocol]->ioctl)(sock, cmd, arg);
+		if (pppox_protos[sk->protocol]->ioctl)
+			rc = pppox_protos[sk->protocol]->ioctl(sock, cmd, arg);
 
 		break;
 	};
 
 	release_sock(sk);
-	return err;
+	return rc;
 }
 
 
 static int pppox_create(struct socket *sock, int protocol)
 {
-	int err = 0;
+	int rc = -EPROTOTYPE;
 
 	if (protocol < 0 || protocol > PX_MAX_PROTO)
-		return -EPROTOTYPE;
-
-	if (proto[protocol] == NULL)
-		return -EPROTONOSUPPORT;
+		goto out;
 
-	err = (*proto[protocol]->create)(sock);
+	rc = -EPROTONOSUPPORT;
+	if (!pppox_protos[protocol] ||
+	    !try_module_get(pppox_protos[protocol]->owner))
+		goto out;
 
-	if (err == 0) {
+	rc = pppox_protos[protocol]->create(sock);
+	if (!rc) {
 		/* We get to set the ioctl handler. */
+		/* And the release handler, for module refcounting */
 		/* For everything else, pppox is just a shell. */
 		sock->ops->ioctl = pppox_ioctl;
-	}
-
-	return err;
+		sock->ops->release = pppox_release;
+	} else
+		module_put(pppox_protos[protocol]->owner);
+out:
+	return rc;
 }
 
 static struct net_proto_family pppox_proto_family = {
 	.family	= PF_PPPOX,
 	.create	= pppox_create,
+	.owner	= THIS_MODULE,
 };
 
 static int __init pppox_init(void)
diff -urN linux-2.5.68-bk9/drivers/net/wireless/airo_cs.c linux-2.5.68-bk10/drivers/net/wireless/airo_cs.c
--- linux-2.5.68-bk9/drivers/net/wireless/airo_cs.c	2003-04-19 19:50:41.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/wireless/airo_cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -161,14 +161,6 @@
 	struct net_device *eth_dev;
 } local_info_t;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
   
   This bit of code is used to avoid unregistering network devices
diff -urN linux-2.5.68-bk9/drivers/net/wireless/netwave_cs.c linux-2.5.68-bk10/drivers/net/wireless/netwave_cs.c
--- linux-2.5.68-bk9/drivers/net/wireless/netwave_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/wireless/netwave_cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -353,14 +353,6 @@
     return readw(staddr);
 }
 
-/**************************************************************************/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /* 
  * Wait until the WOC (Write Operation Complete) bit in the 
  * ASR (Adapter Status Register) is asserted. 
diff -urN linux-2.5.68-bk9/drivers/net/wireless/orinoco_cs.c linux-2.5.68-bk10/drivers/net/wireless/orinoco_cs.c
--- linux-2.5.68-bk9/drivers/net/wireless/orinoco_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/wireless/orinoco_cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -144,14 +144,6 @@
 /* PCMCIA stuff     						    */
 /********************************************************************/
 
-static void
-cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-}
-
-
 /* Remove zombie instances (card removed, detach pending) */
 static void
 flush_stale_links(void)
diff -urN linux-2.5.68-bk9/drivers/net/wireless/ray_cs.c linux-2.5.68-bk10/drivers/net/wireless/ray_cs.c
--- linux-2.5.68-bk9/drivers/net/wireless/ray_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/wireless/ray_cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -314,12 +314,6 @@
 
 static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world.std.com>";
 
-/*===========================================================================*/
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    pcmcia_report_error(handle, &err);
-}
 /*======================================================================
 
     This bit of code is used to avoid unregistering network devices
diff -urN linux-2.5.68-bk9/drivers/net/wireless/wavelan_cs.c linux-2.5.68-bk10/drivers/net/wireless/wavelan_cs.c
--- linux-2.5.68-bk9/drivers/net/wireless/wavelan_cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/net/wireless/wavelan_cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -65,16 +65,6 @@
  * (wavelan modem or i82593)
  */
 
-/*------------------------------------------------------------------*/
-/*
- * Wrapper for reporting error to cardservices
- */
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 #ifdef STRUCT_CHECK
 /*------------------------------------------------------------------*/
 /*
diff -urN linux-2.5.68-bk9/drivers/parport/parport_cs.c linux-2.5.68-bk10/drivers/parport/parport_cs.c
--- linux-2.5.68-bk9/drivers/parport/parport_cs.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk10/drivers/parport/parport_cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -103,14 +103,6 @@
 static dev_info_t dev_info = "parport_cs";
 static dev_link_t *dev_list = NULL;
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     parport_attach() creates an "instance" of the driver, allocating
diff -urN linux-2.5.68-bk9/drivers/pcmcia/cs.c linux-2.5.68-bk10/drivers/pcmcia/cs.c
--- linux-2.5.68-bk9/drivers/pcmcia/cs.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/cs.c	2003-04-30 04:34:56.000000000 -0700
@@ -313,9 +313,9 @@
 /**
  * pcmcia_register_socket - add a new pcmcia socket device
  */
-int pcmcia_register_socket(struct device *dev)
+int pcmcia_register_socket(struct class_device *class_dev)
 {
-	struct pcmcia_socket_class_data *cls_d = to_class_data(dev);
+	struct pcmcia_socket_class_data *cls_d = class_get_devdata(class_dev);
 	socket_info_t *s_info;
 	unsigned int i, j;
 
@@ -375,9 +375,9 @@
 /**
  * pcmcia_unregister_socket - remove a pcmcia socket device
  */
-void pcmcia_unregister_socket(struct device *dev)
+void pcmcia_unregister_socket(struct class_device *class_dev)
 {
-	struct pcmcia_socket_class_data *cls_d = to_class_data(dev);
+	struct pcmcia_socket_class_data *cls_d = class_get_devdata(class_dev);
 	unsigned int i;
 	int j, socket = -1;
 	client_t *client;
@@ -751,9 +751,8 @@
 }
 
 
-int pcmcia_socket_dev_suspend(struct device * dev, u32 state, u32 level)
+int pcmcia_socket_dev_suspend(struct pcmcia_socket_class_data *cls_d, u32 state, u32 level)
 {
-	struct pcmcia_socket_class_data *cls_d = to_class_data(dev);
 	socket_info_t *s;
 	int i;
 
@@ -771,9 +770,8 @@
 }
 EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
 
-int pcmcia_socket_dev_resume(struct device * dev, u32 level)
+int pcmcia_socket_dev_resume(struct pcmcia_socket_class_data *cls_d, u32 level)
 {
-	struct pcmcia_socket_class_data *cls_d = to_class_data(dev);
 	socket_info_t *s;
 	int i;
 
@@ -2423,20 +2421,25 @@
 EXPORT_SYMBOL(pcmcia_suspend_socket);
 EXPORT_SYMBOL(pcmcia_resume_socket);
 
-struct device_class pcmcia_socket_class = {
+struct class pcmcia_socket_class = {
 	.name = "pcmcia_socket",
-	.add_device = &pcmcia_register_socket,
-	.remove_device = &pcmcia_unregister_socket,
 };
 EXPORT_SYMBOL(pcmcia_socket_class);
 
+static struct class_interface pcmcia_socket = {
+	.class = &pcmcia_socket_class,
+	.add = &pcmcia_register_socket,
+	.remove = &pcmcia_unregister_socket,
+};
+
 
 static int __init init_pcmcia_cs(void)
 {
     printk(KERN_INFO "%s\n", release);
     printk(KERN_INFO "  %s\n", options);
     DEBUG(0, "%s\n", version);
-    devclass_register(&pcmcia_socket_class);
+    class_register(&pcmcia_socket_class);
+    class_interface_register(&pcmcia_socket);
 #ifdef CONFIG_PROC_FS
     proc_pccard = proc_mkdir("pccard", proc_bus);
 #endif
@@ -2453,7 +2456,8 @@
     }
 #endif
     release_resource_db();
-    devclass_unregister(&pcmcia_socket_class);
+    class_interface_unregister(&pcmcia_socket);
+    class_unregister(&pcmcia_socket_class);
 }
 
 subsys_initcall(init_pcmcia_cs);
diff -urN linux-2.5.68-bk9/drivers/pcmcia/ds.c linux-2.5.68-bk10/drivers/pcmcia/ds.c
--- linux-2.5.68-bk9/drivers/pcmcia/ds.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/ds.c	2003-04-30 04:34:56.000000000 -0700
@@ -130,11 +130,12 @@
 
 /*====================================================================*/
 
-static void cs_error(client_handle_t handle, int func, int ret)
+void cs_error(client_handle_t handle, int func, int ret)
 {
-    error_info_t err = { func, ret };
-    pcmcia_report_error(handle, &err);
+	error_info_t err = { func, ret };
+	pcmcia_report_error(handle, &err);
 }
+EXPORT_SYMBOL(cs_error);
 
 /*======================================================================*/
 
@@ -957,9 +958,9 @@
 }
 
 
-static int __devinit pcmcia_bus_add_socket_dev(struct device *dev)
+static int pcmcia_bus_add_socket_dev(struct class_device *class_dev)
 {
-	struct pcmcia_socket_class_data *cls_d = dev->class_data;
+	struct pcmcia_socket_class_data *cls_d = class_get_devdata(class_dev);
 	unsigned int i;
 	unsigned int ret = 0;
 
@@ -968,45 +969,42 @@
 
 	down_write(&bus_socket_list_rwsem);
         for (i = 0; i < cls_d->nsock; i++)
-		ret += pcmcia_bus_add_socket(dev, i);
+		ret += pcmcia_bus_add_socket(class_dev->dev, i);
 	up_write(&bus_socket_list_rwsem);
 
 	return ret;
 }
 
-static int __devexit pcmcia_bus_remove_socket_dev(struct device *dev)
+static void pcmcia_bus_remove_socket_dev(struct class_device *class_dev)
 {
-	struct pcmcia_socket_class_data *cls_d = dev->class_data;
+	struct pcmcia_socket_class_data *cls_d = class_get_devdata(class_dev);
 	struct list_head *list_loop;
 	struct list_head *tmp_storage;
 
 	if (!cls_d)
-		return -ENODEV;
+		return;
 
 	flush_scheduled_work();
 
 	down_write(&bus_socket_list_rwsem);
 	list_for_each_safe(list_loop, tmp_storage, &bus_socket_list) {
 		struct pcmcia_bus_socket *bus_sock = container_of(list_loop, struct pcmcia_bus_socket, socket_list);
-		if (bus_sock->socket_dev == dev) {
+		if (bus_sock->socket_dev == class_dev->dev) {
 			pcmcia_deregister_client(bus_sock->handle);
 			list_del(&bus_sock->socket_list);
 			kfree(bus_sock);
 		}
 	}
 	up_write(&bus_socket_list_rwsem);
-	return 0;
+	return;
 }
 
 
 /* the pcmcia_bus_interface is used to handle pcmcia socket devices */
-static struct device_interface pcmcia_bus_interface = {
-	.name = "pcmcia-bus",
-	.devclass = &pcmcia_socket_class,
-	.add_device = &pcmcia_bus_add_socket_dev,
-	.remove_device = __devexit_p(&pcmcia_bus_remove_socket_dev),
-	.kset = { .subsys = &pcmcia_socket_class.subsys, },
-	.devnum = 0,
+static struct class_interface pcmcia_bus_interface = {
+	.class = &pcmcia_socket_class,
+	.add = &pcmcia_bus_add_socket_dev,
+	.remove = &pcmcia_bus_remove_socket_dev,
 };
 
 
@@ -1021,7 +1019,7 @@
 	int i;
 
 	bus_register(&pcmcia_bus_type);
-	interface_register(&pcmcia_bus_interface);
+	class_interface_register(&pcmcia_bus_interface);
 
 	/* Set up character device for user mode clients */
 	i = register_chrdev(0, "pcmcia", &ds_fops);
@@ -1044,7 +1042,7 @@
 
 static void __exit exit_pcmcia_bus(void)
 {
-	interface_unregister(&pcmcia_bus_interface);
+	class_interface_unregister(&pcmcia_bus_interface);
 
 #ifdef CONFIG_PROC_FS
 	if (proc_pccard)
diff -urN linux-2.5.68-bk9/drivers/pcmcia/i82092.c linux-2.5.68-bk10/drivers/pcmcia/i82092.c
--- linux-2.5.68-bk9/drivers/pcmcia/i82092.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/i82092.c	2003-04-30 04:34:56.000000000 -0700
@@ -44,12 +44,14 @@
 
 static int i82092aa_socket_suspend (struct pci_dev *dev, u32 state)
 {
-	return pcmcia_socket_dev_suspend(&dev->dev, state, 0);
+	struct pcmcia_socket_class_data *cls_d = pci_get_drvdata(dev);
+	return pcmcia_socket_dev_suspend(cls_d, state, 0);
 }
 
 static int i82092aa_socket_resume (struct pci_dev *dev)
 {
-	return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE);
+	struct pcmcia_socket_class_data *cls_d = pci_get_drvdata(dev);
+	return pcmcia_socket_dev_resume(cls_d, RESUME_RESTORE_STATE);
 }
 
 static struct pci_driver i82092aa_pci_drv = {
@@ -59,9 +61,6 @@
 	.remove         = __devexit_p(i82092aa_pci_remove),
 	.suspend        = i82092aa_socket_suspend,
 	.resume         = i82092aa_socket_resume,
-	.driver		= {
-		.devclass = &pcmcia_socket_class,
-	},
 };
 
 
@@ -176,7 +175,12 @@
 	memset(cls_d, 0, sizeof(*cls_d));
 	cls_d->nsock = socket_count;
 	cls_d->ops = &i82092aa_operations;
-	dev->dev.class_data = cls_d;
+	pci_set_drvdata(dev, &cls_d);
+	cls_d->class_dev.class = &pcmcia_socket_class;
+	cls_d->class_dev.dev = &dev->dev;
+	strncpy(cls_d->class_dev.class_id, dev->dev.name, BUS_ID_SIZE);
+	class_set_devdata(&cls_d->class_dev, cls_d);
+	class_device_register(&cls_d->class_dev);
 
 	leave("i82092aa_pci_probe");
 	return 0;
@@ -192,11 +196,16 @@
 
 static void __devexit i82092aa_pci_remove(struct pci_dev *dev)
 {
+	struct pcmcia_socket_class_data *cls_d = pci_get_drvdata(dev);
+
 	enter("i82092aa_pci_remove");
 	
 	free_irq(dev->irq, i82092aa_interrupt);
-	if (dev->dev.class_data)
-		kfree(dev->dev.class_data);
+
+	if (cls_d) {
+		class_device_unregister(&cls_d->class_dev);
+		kfree(cls_d);
+	}
 
 	leave("i82092aa_pci_remove");
 }
diff -urN linux-2.5.68-bk9/drivers/pcmcia/i82365.c linux-2.5.68-bk10/drivers/pcmcia/i82365.c
--- linux-2.5.68-bk9/drivers/pcmcia/i82365.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/i82365.c	2003-04-30 04:34:56.000000000 -0700
@@ -1509,9 +1509,8 @@
 static struct device_driver i82365_driver = {
 	.name = "i82365",
 	.bus = &platform_bus_type,
-	.devclass = &pcmcia_socket_class,
-	.suspend = pcmcia_socket_dev_suspend,
-	.resume = pcmcia_socket_dev_resume,
+/*	.suspend = pcmcia_socket_dev_suspend,	FIXME?	*/
+/*	.resume = pcmcia_socket_dev_resume,	FIXME?	*/
 };
 
 static struct platform_device i82365_device = {
@@ -1522,6 +1521,10 @@
 	},
 };
 
+static struct class_device i82365_class_data = {
+	.class = &pcmcia_socket_class,
+};
+
 static int __init init_i82365(void)
 {
     servinfo_t serv;
@@ -1555,9 +1558,12 @@
 #endif
     
     i82365_data.nsock = sockets;
-    i82365_device.dev.class_data = &i82365_data;
+    i82365_class_data.dev = &i82365_device.dev;
+    i82365_class_data.class_data = &i82365_data;
+    strncpy(i82365_class_data.class_id, "i82365", BUS_ID_SIZE);
     
     platform_device_register(&i82365_device);
+    class_device_register(&i82365_class_data);
 
     /* Finally, schedule a polling interrupt */
     if (poll_interval != 0) {
@@ -1578,6 +1584,7 @@
 #ifdef CONFIG_PROC_FS
     for (i = 0; i < sockets; i++) pcic_proc_remove(i);
 #endif
+    class_device_unregister(&i82365_class_data);
     platform_device_unregister(&i82365_device);
     if (poll_interval != 0)
 	del_timer_sync(&poll_timer);
diff -urN linux-2.5.68-bk9/drivers/pcmcia/pci_socket.c linux-2.5.68-bk10/drivers/pcmcia/pci_socket.c
--- linux-2.5.68-bk9/drivers/pcmcia/pci_socket.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/pci_socket.c	2003-04-30 04:34:56.000000000 -0700
@@ -153,7 +153,10 @@
 	socket->cls_d.nsock = 1; /* yenta is 1, no other low-level driver uses
 			     this yet */
 	socket->cls_d.ops = &pci_socket_operations;
-	dev->dev.class_data = &socket->cls_d;
+	socket->cls_d.class_dev.class = &pcmcia_socket_class;
+	socket->cls_d.class_dev.dev = &dev->dev;
+	strncpy(socket->cls_d.class_dev.class_id, dev->dev.bus_id, BUS_ID_SIZE);
+	class_set_devdata(&socket->cls_d.class_dev, &socket->cls_d);
 
 	/* prepare pci_socket_t */
 	socket->dev = dev;
@@ -161,10 +164,11 @@
 	pci_set_drvdata(dev, socket);
 	spin_lock_init(&socket->event_lock);
 	err = socket->op->open(socket);
-	if(err)
-	{
+	if (err) {
 		socket->dev = NULL;
 		pci_set_drvdata(dev, NULL);
+	} else {
+		class_device_register(&socket->cls_d.class_dev);
 	}
 	return err;
 }
@@ -194,17 +198,20 @@
 	/* note: we are already unregistered from the cs core */
 	if (socket->op && socket->op->close)
 		socket->op->close(socket);
+	class_device_unregister(&socket->cls_d.class_dev);
 	pci_set_drvdata(dev, NULL);
 }
 
 static int cardbus_suspend (struct pci_dev *dev, u32 state)
 {
-	return pcmcia_socket_dev_suspend(&dev->dev, state, 0);
+	pci_socket_t *socket = pci_get_drvdata(dev);
+	return pcmcia_socket_dev_suspend(&socket->cls_d, state, 0);
 }
 
 static int cardbus_resume (struct pci_dev *dev)
 {
-	return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE);
+	pci_socket_t *socket = pci_get_drvdata(dev);
+	return pcmcia_socket_dev_resume(&socket->cls_d, RESUME_RESTORE_STATE);
 }
 
 
@@ -227,9 +234,6 @@
 	.remove		= __devexit_p(cardbus_remove),
 	.suspend	= cardbus_suspend,
 	.resume		= cardbus_resume,
-	.driver		= {
-		.devclass = &pcmcia_socket_class,
-	},
 };
 
 static int __init pci_socket_init(void)
diff -urN linux-2.5.68-bk9/drivers/pcmcia/sa1111_generic.c linux-2.5.68-bk10/drivers/pcmcia/sa1111_generic.c
--- linux-2.5.68-bk9/drivers/pcmcia/sa1111_generic.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/sa1111_generic.c	2003-04-30 04:34:56.000000000 -0700
@@ -176,7 +176,6 @@
 	.drv = {
 		.name		= "sa1111-pcmcia",
 		.bus		= &sa1111_bus_type,
-		.devclass	= &pcmcia_socket_class,
 		.probe		= pcmcia_probe,
 		.remove		= __devexit_p(pcmcia_remove),
 		.suspend 	= pcmcia_socket_dev_suspend,
diff -urN linux-2.5.68-bk9/drivers/pcmcia/tcic.c linux-2.5.68-bk10/drivers/pcmcia/tcic.c
--- linux-2.5.68-bk9/drivers/pcmcia/tcic.c	2003-04-30 04:34:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/pcmcia/tcic.c	2003-04-30 04:34:56.000000000 -0700
@@ -379,9 +379,8 @@
 static struct device_driver tcic_driver = {
 	.name = "tcic-pcmcia",
 	.bus = &platform_bus_type,
-	.devclass = &pcmcia_socket_class,
-	.suspend = pcmcia_socket_dev_suspend,
-	.resume = pcmcia_socket_dev_resume,
+/*	.suspend = pcmcia_socket_dev_suspend,	FIXME?	*/
+/*	.resume = pcmcia_socket_dev_resume,	FIXME?	*/
 };
 
 static struct platform_device tcic_device = {
@@ -392,6 +391,10 @@
 	},
 };
 
+static struct class_device tcic_class_data = {
+	.class = &pcmcia_socket_class,
+};
+
 static int __init init_tcic(void)
 {
     int i, sock;
@@ -522,9 +525,12 @@
     tcic_interrupt(0, NULL, NULL);
 
     tcic_data.nsock = sockets;
-    tcic_device.dev.class_data = &tcic_data;
-
+    tcic_class_data.dev = &tcic_device.dev;
+    tcic_class_data.class_data = &tcic_data;
+    strncpy(tcic_class_data.class_id, "tcic-pcmcia", BUS_ID_SIZE);
+    
     platform_device_register(&tcic_device);
+    class_device_register(&tcic_class_data);
 
     return 0;
     
@@ -540,6 +546,7 @@
 	free_irq(cs_irq, tcic_interrupt);
     }
     release_region(tcic_base, 16);
+    class_device_unregister(&tcic_class_data);
     platform_device_unregister(&tcic_device);
     driver_unregister(&tcic_driver);
 } /* exit_tcic */
diff -urN linux-2.5.68-bk9/drivers/scsi/hosts.c linux-2.5.68-bk10/drivers/scsi/hosts.c
--- linux-2.5.68-bk9/drivers/scsi/hosts.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/hosts.c	2003-04-30 04:34:57.000000000 -0700
@@ -294,7 +294,6 @@
 			sht->info ? sht->info(shost) : sht->name);
 
 	if (dev) {
-		dev->class_data = shost;
 		shost->host_gendev = dev;
 	}
 
diff -urN linux-2.5.68-bk9/drivers/scsi/hosts.h linux-2.5.68-bk10/drivers/scsi/hosts.h
--- linux-2.5.68-bk9/drivers/scsi/hosts.h	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/hosts.h	2003-04-30 04:34:57.000000000 -0700
@@ -495,7 +495,7 @@
         __attribute__ ((aligned (sizeof(unsigned long))));
 };
 
-#define	to_scsi_host(d)	d->class_data
+#define	to_scsi_host(d)	d->driver_data	/* Major logical breakage, but we compile again... */
 	
 /*
  * These two functions are used to allocate and free a pseudo device
@@ -607,7 +607,7 @@
 extern int scsi_upper_driver_register(struct Scsi_Device_Template *);
 extern void scsi_upper_driver_unregister(struct Scsi_Device_Template *);
 
-extern struct device_class shost_devclass;
+extern struct class shost_class;
 
 #endif
 /*
diff -urN linux-2.5.68-bk9/drivers/scsi/pcmcia/aha152x_stub.c linux-2.5.68-bk10/drivers/scsi/pcmcia/aha152x_stub.c
--- linux-2.5.68-bk9/drivers/scsi/pcmcia/aha152x_stub.c	2003-04-19 19:50:46.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/pcmcia/aha152x_stub.c	2003-04-30 04:34:57.000000000 -0700
@@ -113,16 +113,6 @@
 static dev_link_t *dev_list;
 static dev_info_t dev_info = "aha152x_cs";
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
 static dev_link_t *aha152x_attach(void)
 {
     scsi_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/scsi/pcmcia/fdomain_stub.c linux-2.5.68-bk10/drivers/scsi/pcmcia/fdomain_stub.c
--- linux-2.5.68-bk9/drivers/scsi/pcmcia/fdomain_stub.c	2003-04-19 19:50:00.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/pcmcia/fdomain_stub.c	2003-04-30 04:34:57.000000000 -0700
@@ -103,16 +103,6 @@
 
 static dev_info_t dev_info = "fdomain_cs";
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-    error_info_t err = { func, ret };
-    CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
 static dev_link_t *fdomain_attach(void)
 {
     scsi_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/scsi/pcmcia/nsp_cs.c linux-2.5.68-bk10/drivers/scsi/pcmcia/nsp_cs.c
--- linux-2.5.68-bk9/drivers/scsi/pcmcia/nsp_cs.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/pcmcia/nsp_cs.c	2003-04-30 04:34:57.000000000 -0700
@@ -1469,13 +1469,6 @@
   PCMCIA functions
 **********************************************************************/
 
-/*====================================================================*/
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
     nsp_cs_attach() creates an "instance" of the driver, allocating
     local data structures for one device.  The device is registered
diff -urN linux-2.5.68-bk9/drivers/scsi/pcmcia/qlogic_stub.c linux-2.5.68-bk10/drivers/scsi/pcmcia/qlogic_stub.c
--- linux-2.5.68-bk9/drivers/scsi/pcmcia/qlogic_stub.c	2003-04-19 19:49:51.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/pcmcia/qlogic_stub.c	2003-04-30 04:34:57.000000000 -0700
@@ -102,16 +102,6 @@
 
 static dev_info_t dev_info = "qlogic_cs";
 
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
 static dev_link_t *qlogic_attach(void)
 {
 	scsi_info_t *info;
diff -urN linux-2.5.68-bk9/drivers/scsi/scsi_debug.c linux-2.5.68-bk10/drivers/scsi/scsi_debug.c
--- linux-2.5.68-bk9/drivers/scsi/scsi_debug.c	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/scsi_debug.c	2003-04-30 04:34:57.000000000 -0700
@@ -183,7 +183,6 @@
 	.name 		= sdebug_proc_name,
 	.probe          = sdebug_driver_probe,
 	.remove         = sdebug_driver_remove,
-	.devclass 	= &shost_devclass,
 };
 
 static const int check_condition_result = 
diff -urN linux-2.5.68-bk9/drivers/scsi/scsi_syms.c linux-2.5.68-bk10/drivers/scsi/scsi_syms.c
--- linux-2.5.68-bk9/drivers/scsi/scsi_syms.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/scsi_syms.c	2003-04-30 04:34:57.000000000 -0700
@@ -112,4 +112,4 @@
 /*
  * sysfs support
  */
-EXPORT_SYMBOL(shost_devclass);
+EXPORT_SYMBOL(shost_class);
diff -urN linux-2.5.68-bk9/drivers/scsi/scsi_sysfs.c linux-2.5.68-bk10/drivers/scsi/scsi_sysfs.c
--- linux-2.5.68-bk9/drivers/scsi/scsi_sysfs.c	2003-04-19 19:48:54.000000000 -0700
+++ linux-2.5.68-bk10/drivers/scsi/scsi_sysfs.c	2003-04-30 04:34:57.000000000 -0700
@@ -75,30 +75,8 @@
 
 DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL);
 
-static int scsi_host_class_add_dev(struct device * dev)
-{
-	int i;
-
-	device_create_file(dev, &dev_attr_class_name);
-	for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
-		device_create_file(dev, shost_attrs[i]);
-
-	return 0;
-}
-
-static void scsi_host_class_rm_dev(struct device * dev)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(shost_attrs); i++)
-		device_remove_file(dev, shost_attrs[i]);
-	device_remove_file(dev, &dev_attr_class_name);
-}
-
-struct device_class shost_devclass = {
+struct class shost_class = {
 	.name		= "scsi-host",
-	.add_device	= scsi_host_class_add_dev,
-	.remove_device	= scsi_host_class_rm_dev,
 };
 
 /**
@@ -136,14 +114,14 @@
 int scsi_sysfs_register(void)
 {
 	bus_register(&scsi_bus_type);
-	devclass_register(&shost_devclass);
+	class_register(&shost_class);
 
 	return 0;
 }
 
 void scsi_sysfs_unregister(void)
 {
-	devclass_unregister(&shost_devclass);
+	class_unregister(&shost_class);
 	bus_unregister(&scsi_bus_type);
 }
 
diff -urN linux-2.5.68-bk9/drivers/serial/8250_acorn.c linux-2.5.68-bk10/drivers/serial/8250_acorn.c
--- linux-2.5.68-bk9/drivers/serial/8250_acorn.c	2003-04-19 19:50:41.000000000 -0700
+++ linux-2.5.68-bk10/drivers/serial/8250_acorn.c	2003-04-30 04:34:57.000000000 -0700
@@ -129,7 +129,6 @@
 	.remove 	= __devexit_p(serial_card_remove),
 	.id_table	= serial_cids,
 	.drv = {
-		.devclass	= &tty_devclass,
 		.name		= "8250_acorn",
 	},
 };
diff -urN linux-2.5.68-bk9/drivers/serial/8250_cs.c linux-2.5.68-bk10/drivers/serial/8250_cs.c
--- linux-2.5.68-bk9/drivers/serial/8250_cs.c	2003-04-19 19:49:30.000000000 -0700
+++ linux-2.5.68-bk10/drivers/serial/8250_cs.c	2003-04-30 04:34:57.000000000 -0700
@@ -122,15 +122,6 @@
 
 static dev_link_t *dev_list = NULL;
 
-/*====================================================================*/
-
-static void
-cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err = { func, ret };
-	CardServices(ReportError, handle, &err);
-}
-
 /*======================================================================
 
     After a card is removed, do_serial_release() will unregister
diff -urN linux-2.5.68-bk9/drivers/serial/8250_pci.c linux-2.5.68-bk10/drivers/serial/8250_pci.c
--- linux-2.5.68-bk9/drivers/serial/8250_pci.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/drivers/serial/8250_pci.c	2003-04-30 04:34:57.000000000 -0700
@@ -127,7 +127,7 @@
 			return -ENOMEM;
 
 		req->io_type = UPIO_MEM;
-		req->iomap_base = port;
+		req->iomap_base = port + offset;
 		req->iomem_base = priv->remapped_bar[bar] + offset;
 		req->iomem_reg_shift = regshift;
 	} else {
@@ -2044,9 +2044,6 @@
 	.suspend	= pciserial_suspend_one,
 	.resume		= pciserial_resume_one,
 	.id_table	= serial_pci_tbl,
-	.driver = {
-		.devclass = &tty_devclass,
-	},
 };
 
 static int __init serial8250_pci_init(void)
diff -urN linux-2.5.68-bk9/drivers/serial/sa1100.c linux-2.5.68-bk10/drivers/serial/sa1100.c
--- linux-2.5.68-bk9/drivers/serial/sa1100.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/drivers/serial/sa1100.c	2003-04-30 04:34:57.000000000 -0700
@@ -879,7 +879,6 @@
 static struct device_driver sa11x0_serial_driver = {
 	.name		= "sa11x0_serial",
 	.bus		= &system_bus_type,
-	.devclass	= &tty_devclass,
 	.suspend	= sa1100_serial_suspend,
 	.resume		= sa1100_serial_resume,
 };
diff -urN linux-2.5.68-bk9/drivers/telephony/ixj_pcmcia.c linux-2.5.68-bk10/drivers/telephony/ixj_pcmcia.c
--- linux-2.5.68-bk9/drivers/telephony/ixj_pcmcia.c	2003-04-19 19:50:44.000000000 -0700
+++ linux-2.5.68-bk10/drivers/telephony/ixj_pcmcia.c	2003-04-30 04:34:57.000000000 -0700
@@ -43,15 +43,6 @@
 static dev_info_t dev_info = "ixj_cs";
 static dev_link_t *dev_list = NULL;
 
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-	error_info_t err =
-	{
-		func, ret
-	};
-	CardServices(ReportError, handle, &err);
-}
-
 static dev_link_t *ixj_attach(void)
 {
 	client_reg_t client_reg;
diff -urN linux-2.5.68-bk9/drivers/usb/input/hid-core.c linux-2.5.68-bk10/drivers/usb/input/hid-core.c
--- linux-2.5.68-bk9/drivers/usb/input/hid-core.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk10/drivers/usb/input/hid-core.c	2003-04-30 04:34:57.000000000 -0700
@@ -1664,9 +1664,6 @@
 	.probe =	hid_probe,
 	.disconnect =	hid_disconnect,
 	.id_table =	hid_usb_ids,
-	.driver	= {
-		.devclass = &input_devclass,
-	},
 };
 
 static int __init hid_init(void)
diff -urN linux-2.5.68-bk9/drivers/usb/serial/bus.c linux-2.5.68-bk10/drivers/usb/serial/bus.c
--- linux-2.5.68-bk9/drivers/usb/serial/bus.c	2003-04-19 19:51:22.000000000 -0700
+++ linux-2.5.68-bk10/drivers/usb/serial/bus.c	2003-04-30 04:34:58.000000000 -0700
@@ -142,7 +142,6 @@
 	device->driver.bus = &usb_serial_bus_type;
 	device->driver.probe = usb_serial_device_probe;
 	device->driver.remove = usb_serial_device_remove;
-	device->driver.devclass = &tty_devclass;
 
 	retval = driver_register(&device->driver);
 
diff -urN linux-2.5.68-bk9/include/linux/cpufreq.h linux-2.5.68-bk10/include/linux/cpufreq.h
--- linux-2.5.68-bk9/include/linux/cpufreq.h	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/cpufreq.h	2003-04-30 04:34:58.000000000 -0700
@@ -68,7 +68,6 @@
         unsigned int            policy; /* see above */
 	struct cpufreq_governor *governor; /* see below */
 	struct cpufreq_cpuinfo  cpuinfo;     /* see above */
-	struct device		* dev;
 	struct kobject		kobj;
  	struct semaphore	lock;   /* CPU ->setpolicy or ->target may
 					   only be called once a time */
diff -urN linux-2.5.68-bk9/include/linux/devfs_fs_kernel.h linux-2.5.68-bk10/include/linux/devfs_fs_kernel.h
--- linux-2.5.68-bk9/include/linux/devfs_fs_kernel.h	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/devfs_fs_kernel.h	2003-04-30 04:34:58.000000000 -0700
@@ -62,7 +62,7 @@
 static inline void devfs_remove(const char *fmt, ...)
 {
 }
-static inline int devfs_register_tape (devfs_handle_t de)
+static inline int devfs_register_tape (const char *name)
 {
     return -1;
 }
diff -urN linux-2.5.68-bk9/include/linux/device.h linux-2.5.68-bk10/include/linux/device.h
--- linux-2.5.68-bk9/include/linux/device.h	2003-04-19 19:50:48.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/device.h	2003-04-30 04:34:58.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  * device.h - generic, centralized driver model
  *
- * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
+ * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
  *
  * This is a relatively simple centralized driver model.
  * The data structures were mainly lifted directly from the PCI
@@ -60,7 +60,8 @@
 
 struct device;
 struct device_driver;
-struct device_class;
+struct class;
+struct class_device;
 
 struct bus_type {
 	char			* name;
@@ -116,11 +117,9 @@
 struct device_driver {
 	char			* name;
 	struct bus_type		* bus;
-	struct device_class	* devclass;
 
 	struct semaphore	unload_sem;
 	struct kobject		kobj;
-	struct list_head	class_list;
 	struct list_head	devices;
 
 	int	(*probe)	(struct device * dev);
@@ -160,74 +159,106 @@
 /*
  * device classes
  */
-struct device_class {
+struct class {
 	char			* name;
-	u32			devnum;
 
 	struct subsystem	subsys;
-	struct kset		devices;
-	struct kset		drivers;
+	struct list_head	children;
+	struct list_head	interfaces;
 
-	int	(*add_device)(struct device *);
-	void	(*remove_device)(struct device *);
-	int	(*hotplug)(struct device *dev, char **envp, 
+	int	(*hotplug)(struct class_device *dev, char **envp, 
 			   int num_envp, char *buffer, int buffer_size);
 };
 
-extern int devclass_register(struct device_class *);
-extern void devclass_unregister(struct device_class *);
+extern int class_register(struct class *);
+extern void class_unregister(struct class *);
 
-extern struct device_class * get_devclass(struct device_class *);
-extern void put_devclass(struct device_class *);
+extern struct class * class_get(struct class *);
+extern void class_put(struct class *);
 
 
-struct devclass_attribute {
+struct class_attribute {
 	struct attribute	attr;
-	ssize_t (*show)(struct device_class *, char * buf);
-	ssize_t (*store)(struct device_class *, const char * buf, size_t count);
+	ssize_t (*show)(struct class *, char * buf);
+	ssize_t (*store)(struct class *, const char * buf, size_t count);
 };
 
-#define DEVCLASS_ATTR(_name,_str,_mode,_show,_store)	\
-struct devclass_attribute devclass_attr_##_name = { 		\
-	.attr = {.name	= _str,	.mode	= _mode },	\
-	.show	= _show,				\
-	.store	= _store,				\
+#define CLASS_ATTR(_name,_mode,_show,_store)			\
+struct class_attribute class_attr_##_name = { 			\
+	.attr = {.name = __stringify(_name), .mode = _mode },	\
+	.show	= _show,					\
+	.store	= _store,					\
 };
 
-extern int devclass_create_file(struct device_class *, struct devclass_attribute *);
-extern void devclass_remove_file(struct device_class *, struct devclass_attribute *);
+extern int class_create_file(struct class *, struct class_attribute *);
+extern void class_remove_file(struct class *, struct class_attribute *);
 
 
-/*
- * device interfaces
- * These are the logical interfaces of device classes. 
- * These entities map directly to specific userspace interfaces, like 
- * device nodes.
- * Interfaces are registered with the device class they belong to. When
- * a device is registered with the class, each interface's add_device 
- * callback is called. It is up to the interface to decide whether or not
- * it supports the device.
- */
+struct class_device {
+	struct list_head	node;
 
-struct device_interface {
-	char			* name;
-	struct device_class	* devclass;
+	struct kobject		kobj;
+	struct class		* class;	/* required */
+	struct device		* dev;		/* not necessary, but nice to have */
+	void			* class_data;	/* class-specific data */
+
+	char	class_id[BUS_ID_SIZE];	/* unique to this class */
+};
+
+static inline void *
+class_get_devdata (struct class_device *dev)
+{
+	return dev->class_data;
+}
+
+static inline void
+class_set_devdata (struct class_device *dev, void *data)
+{
+	dev->class_data = data;
+}
+
+
+extern int class_device_register(struct class_device *);
+extern void class_device_unregister(struct class_device *);
+extern void class_device_initialize(struct class_device *);
+extern int class_device_add(struct class_device *);
+extern void class_device_del(struct class_device *);
+
+extern struct class_device * class_device_get(struct class_device *);
+extern void class_device_put(struct class_device *);
+
+struct class_device_attribute {
+	struct attribute	attr;
+	ssize_t (*show)(struct class_device *, char * buf);
+	ssize_t (*store)(struct class_device *, const char * buf, size_t count);
+};
+
+#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)		\
+struct class_device_attribute class_device_attr_##_name = { 	\
+	.attr = {.name = __stringify(_name), .mode = _mode },	\
+	.show	= _show,					\
+	.store	= _store,					\
+};
 
-	struct kset		kset;
-	u32			devnum;
+extern int class_device_create_file(struct class_device *, struct class_device_attribute *);
+extern void class_device_remove_file(struct class_device *, struct class_device_attribute *);
 
-	int (*add_device)	(struct device *);
-	int (*remove_device)	(struct device *);
+
+struct class_interface {
+	struct list_head	node;
+	struct class		*class;
+
+	int (*add)	(struct class_device *);
+	void (*remove)	(struct class_device *);
 };
 
-extern int interface_register(struct device_interface *);
-extern void interface_unregister(struct device_interface *);
+extern int class_interface_register(struct class_interface *);
+extern void class_interface_unregister(struct class_interface *);
 
 
 struct device {
 	struct list_head node;		/* node in sibling list */
 	struct list_head bus_list;	/* node in bus's list */
-	struct list_head class_list;
 	struct list_head driver_list;
 	struct list_head children;
 	struct device 	* parent;
@@ -240,14 +271,10 @@
 	struct device_driver *driver;	/* which driver has allocated this
 					   device */
 	void		*driver_data;	/* data private to the driver */
-
-	u32		class_num;	/* class-enumerated value */
-	void		* class_data;	/* class-specific data */
-
 	void		*platform_data;	/* Platform specific data (e.g. ACPI,
 					   BIOS data relevant to device) */
 
-	u32		power_state;  /* Current operating state. In
+	u32		power_state;	/* Current operating state. In
 					   ACPI-speak, this is D0-D3, D0
 					   being fully functional, and D3
 					   being off. */
@@ -347,6 +374,7 @@
 	u32		id;
 	struct sys_root	* root;
 	struct device	dev;
+	struct class_device class_dev;
 };
 
 extern int sys_device_register(struct sys_device *);
diff -urN linux-2.5.68-bk9/include/linux/if_pppox.h linux-2.5.68-bk10/include/linux/if_pppox.h
--- linux-2.5.68-bk9/include/linux/if_pppox.h	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/if_pppox.h	2003-04-30 04:34:58.000000000 -0700
@@ -134,10 +134,15 @@
 
 #define pppox_sk(__sk) ((struct pppox_opt *)(__sk)->protinfo)
 
+struct module;
+
 struct pppox_proto {
-	int (*create)(struct socket *sock);
-	int (*ioctl)(struct socket *sock, unsigned int cmd,
-		     unsigned long arg);
+	int		(*create)(struct socket *sock);
+	int		(*ioctl)(struct socket *sock, unsigned int cmd,
+				 unsigned long arg);
+	int		(*release)(struct socket *sock);
+	void            (*sk_free)(struct sock *sk);
+	struct module	*owner;
 };
 
 extern int register_pppox_proto(int proto_num, struct pppox_proto *pp);
@@ -145,6 +150,9 @@
 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
 extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd,
 			       unsigned long arg);
+extern struct sock *pppox_sk_alloc(struct socket *sock, int protocol,
+				   int priority, int zero_it,
+				   kmem_cache_t *slab);
 
 /* PPPoX socket states */
 enum {
diff -urN linux-2.5.68-bk9/include/linux/input.h linux-2.5.68-bk10/include/linux/input.h
--- linux-2.5.68-bk9/include/linux/input.h	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/input.h	2003-04-30 04:34:58.000000000 -0700
@@ -908,7 +908,7 @@
 #define input_regs(a,b)		do { (a)->regs = (b); } while (0)
 #define input_sync(a)		do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0)
 
-extern struct device_class input_devclass;
+extern struct class input_class;
 
 #endif
 #endif
diff -urN linux-2.5.68-bk9/include/linux/list.h linux-2.5.68-bk10/include/linux/list.h
--- linux-2.5.68-bk9/include/linux/list.h	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/list.h	2003-04-30 04:34:58.000000000 -0700
@@ -335,6 +335,16 @@
 		     prefetch(pos->member.next))
 
 
+/**
+ * list_for_each_continue_rcu	-	iterate over an rcu-protected list 
+ *			continuing from existing point.
+ * @pos:	the &struct list_head to use as a loop counter.
+ * @head:	the head for your list.
+ */
+#define list_for_each_continue_rcu(pos, head) \
+	for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \
+        	(pos) = (pos)->next, ({ smp_read_barrier_depends(); 0;}), prefetch((pos)->next))
+
 /* 
  * Double linked lists with a single pointer list head. 
  * Mostly useful for hash tables where the two pointer list head is 
diff -urN linux-2.5.68-bk9/include/linux/tty_driver.h linux-2.5.68-bk10/include/linux/tty_driver.h
--- linux-2.5.68-bk9/include/linux/tty_driver.h	2003-04-19 19:50:05.000000000 -0700
+++ linux-2.5.68-bk10/include/linux/tty_driver.h	2003-04-30 04:34:58.000000000 -0700
@@ -231,6 +231,4 @@
 #define SERIAL_TYPE_NORMAL	1
 #define SERIAL_TYPE_CALLOUT	2
 
-extern struct device_class tty_devclass;
-
 #endif /* #ifdef _LINUX_TTY_DRIVER_H */
diff -urN linux-2.5.68-bk9/include/pcmcia/ds.h linux-2.5.68-bk10/include/pcmcia/ds.h
--- linux-2.5.68-bk9/include/pcmcia/ds.h	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/include/pcmcia/ds.h	2003-04-30 04:34:58.000000000 -0700
@@ -141,11 +141,6 @@
 #define DEV_OK(l) \
     ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT)))
 
-int register_pccard_driver(dev_info_t *dev_info,
-			   dev_link_t *(*attach)(void),
-			   void (*detach)(dev_link_t *));
-
-int unregister_pccard_driver(dev_info_t *dev_info);
 
 extern struct bus_type pcmcia_bus_type;
 
@@ -157,9 +152,18 @@
 	struct device_driver	drv;
 };
 
+/* driver registration */
 int pcmcia_register_driver(struct pcmcia_driver *driver);
 void pcmcia_unregister_driver(struct pcmcia_driver *driver);
 
-#endif /* __KERNEL__ */
+/* legacy driver registration interface.  don't use in new code */
+int register_pccard_driver(dev_info_t *dev_info,
+			   dev_link_t *(*attach)(void),
+			   void (*detach)(dev_link_t *));
+int unregister_pccard_driver(dev_info_t *dev_info);
+
+/* error reporting */
+void cs_error(client_handle_t handle, int func, int ret);
 
+#endif /* __KERNEL__ */
 #endif /* _LINUX_DS_H */
diff -urN linux-2.5.68-bk9/include/pcmcia/ss.h linux-2.5.68-bk10/include/pcmcia/ss.h
--- linux-2.5.68-bk9/include/pcmcia/ss.h	2003-04-19 19:51:11.000000000 -0700
+++ linux-2.5.68-bk10/include/pcmcia/ss.h	2003-04-30 04:34:58.000000000 -0700
@@ -148,12 +148,13 @@
 	 * returned to driver) = sock_offset + (0, 1, .. , (nsock-1) */
 	struct pccard_operations *ops;		/* see above */
 	void *s_info;				/* socket_info_t */
+	struct class_device class_dev;		/* generic class structure */
 };
 
-extern struct device_class pcmcia_socket_class;
+extern struct class pcmcia_socket_class;
 
 /* socket drivers are expected to use these callbacks in their .drv struct */
-int pcmcia_socket_dev_suspend(struct device * dev, u32 state, u32 level);
-int pcmcia_socket_dev_resume(struct device * dev, u32 level);
+extern int pcmcia_socket_dev_suspend(struct pcmcia_socket_class_data *cls_d, u32 state, u32 level);
+extern int pcmcia_socket_dev_resume(struct pcmcia_socket_class_data *cls_d, u32 level);
 
 #endif /* _LINUX_SS_H */
diff -urN linux-2.5.68-bk9/kernel/cpufreq.c linux-2.5.68-bk10/kernel/cpufreq.c
--- linux-2.5.68-bk9/kernel/cpufreq.c	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk10/kernel/cpufreq.c	2003-04-30 04:34:58.000000000 -0700
@@ -49,23 +49,17 @@
 static LIST_HEAD(cpufreq_governor_list);
 static DECLARE_MUTEX		(cpufreq_governor_sem);
 
-static struct device_interface cpufreq_interface;
+static struct class_interface cpufreq_interface;
 
 static int cpufreq_cpu_get(unsigned int cpu) {
 	if (cpu >= NR_CPUS)
 		return 0;
 
-	if (!kset_get(&cpufreq_interface.kset))
-		return 0;
-
-	if (!try_module_get(cpufreq_driver->owner)) {
-		kset_put(&cpufreq_interface.kset);
+	if (!try_module_get(cpufreq_driver->owner))
 		return 0;
-	}
 
 	if (!kobject_get(&cpufreq_driver->policy[cpu].kobj)) {
 		module_put(cpufreq_driver->owner);
-		kset_put(&cpufreq_interface.kset);
 		return 0;
 	}
 
@@ -75,7 +69,6 @@
 static void cpufreq_cpu_put(unsigned int cpu) {
 	kobject_put(&cpufreq_driver->policy[cpu].kobj);
 	module_put(cpufreq_driver->owner);
-	kset_put(&cpufreq_interface.kset);
 }
 
 /*********************************************************************
@@ -115,24 +108,20 @@
 
 
 /* forward declarations */
-static int cpufreq_add_dev (struct device * dev);
-static int cpufreq_remove_dev (struct device * dev);
+static int cpufreq_add_dev (struct class_device * dev);
+static void cpufreq_remove_dev (struct class_device * dev);
 
 /* drivers/base/cpu.c */
 extern struct device_class cpu_devclass;
 
-static struct device_interface cpufreq_interface = {
-        .name = "cpufreq",
-        .devclass = &cpu_devclass,
-        .add_device = &cpufreq_add_dev,
-        .remove_device = &cpufreq_remove_dev,
-	.kset = { .subsys = &cpu_devclass.subsys, },
-        .devnum = 0,
+static struct class_interface cpufreq_interface = {
+        .add =		&cpufreq_add_dev,
+        .remove =	&cpufreq_remove_dev,
 };
 
-static inline int to_cpu_nr (struct device *dev)
+static inline int to_cpu_nr (struct class_device *dev)
 {
-	struct sys_device * cpu_sys_dev = container_of(dev, struct sys_device, dev);
+	struct sys_device * cpu_sys_dev = container_of(dev->dev, struct sys_device, dev);
 	return (cpu_sys_dev->id);
 }
 
@@ -334,21 +323,16 @@
  *
  * Adds the cpufreq interface for a CPU device. 
  */
-static int cpufreq_add_dev (struct device * dev)
+static int cpufreq_add_dev (struct class_device * class_dev)
 {
-	unsigned int cpu = to_cpu_nr(dev);
+	unsigned int cpu = to_cpu_nr(class_dev);
 	int ret = 0;
 	struct cpufreq_policy new_policy;
 	struct cpufreq_policy *policy;
 	struct freq_attr **drv_attr;
 
-	if (!kset_get(&cpufreq_interface.kset))
-		return -EINVAL;
-
-	if (!try_module_get(cpufreq_driver->owner)) {
-		kset_put(&cpufreq_interface.kset);
+	if (!try_module_get(cpufreq_driver->owner))
 		return -EINVAL;
-	}
 
 	/* call driver. From then on the cpufreq must be able
 	 * to accept all calls to ->verify and ->setpolicy for this CPU
@@ -366,15 +350,15 @@
 	memcpy(&new_policy, 
 	       policy, 
 	       sizeof(struct cpufreq_policy));
+	class_set_devdata(class_dev, policy);
 	up(&cpufreq_driver_sem);
 
 	init_MUTEX(&policy->lock);
 	/* prepare interface data */
-	policy->kobj.parent = &dev->kobj;
+	policy->kobj.parent = &class_dev->kobj;
 	policy->kobj.ktype = &ktype_cpufreq;
-	policy->dev = dev;
-	strncpy(policy->kobj.name, 
-		cpufreq_interface.name, KOBJ_NAME_LEN);
+//	policy->dev = dev->dev;
+	strncpy(policy->kobj.name, "cpufreq", KOBJ_NAME_LEN);
 
 	ret = kobject_register(&policy->kobj);
 	if (ret)
@@ -385,7 +369,9 @@
 		sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
 		drv_attr++;
 	}
+	/* set up files for this cpu device */
 
+	
 	/* set default policy */
 	ret = cpufreq_set_policy(&new_policy);
 	if (ret)
@@ -393,7 +379,6 @@
 
  out:
 	module_put(cpufreq_driver->owner);
-	kset_put(&cpufreq_interface.kset);
 	return ret;
 }
 
@@ -403,17 +388,12 @@
  *
  * Removes the cpufreq interface for a CPU device.
  */
-static int cpufreq_remove_dev (struct device * dev)
+static void cpufreq_remove_dev (struct class_device * class_dev)
 {
-	unsigned int cpu = to_cpu_nr(dev);
-
-	if (!kset_get(&cpufreq_interface.kset))
-		return -EINVAL;
+	unsigned int cpu = to_cpu_nr(class_dev);
 
-	if (!kobject_get(&cpufreq_driver->policy[cpu].kobj)) {
-		kset_put(&cpufreq_interface.kset);
-		return -EINVAL;
-	}
+	if (!kobject_get(&cpufreq_driver->policy[cpu].kobj))
+		return;
 
 	down(&cpufreq_driver_sem);
 	if ((cpufreq_driver->target) && 
@@ -433,8 +413,7 @@
 
 	up(&cpufreq_driver_sem);
 	kobject_put(&cpufreq_driver->policy[cpu].kobj);
-	kset_put(&cpufreq_interface.kset);
-	return 0;
+	return;
 }
 
 
@@ -840,12 +819,6 @@
 	    ((!driver_data->setpolicy) && (!driver_data->target)))
 		return -EINVAL;
 
-
-	if (kset_get(&cpufreq_interface.kset)) {
-		kset_put(&cpufreq_interface.kset);
-		return -EBUSY;
-	}
-
 	down(&cpufreq_driver_sem);
 	if (cpufreq_driver) {
 		up(&cpufreq_driver_sem);		
@@ -862,7 +835,7 @@
 
 	memset(cpufreq_driver->policy, 0, NR_CPUS * sizeof(struct cpufreq_policy));
 
-	return interface_register(&cpufreq_interface);
+	return class_interface_register(&cpufreq_interface);
 }
 EXPORT_SYMBOL_GPL(cpufreq_register_driver);
 
@@ -877,16 +850,10 @@
  */
 int cpufreq_unregister_driver(struct cpufreq_driver *driver)
 {
-	if (!kset_get(&cpufreq_interface.kset))
-		return 0;
-
-	if (!cpufreq_driver || (driver != cpufreq_driver)) {
-		kset_put(&cpufreq_interface.kset);
+	if (!cpufreq_driver || (driver != cpufreq_driver))
 		return -EINVAL;
-	}
 
-	kset_put(&cpufreq_interface.kset);
-	interface_unregister(&cpufreq_interface);
+	class_interface_unregister(&cpufreq_interface);
 
 	down(&cpufreq_driver_sem);
 	kfree(cpufreq_driver->policy);
@@ -914,9 +881,6 @@
 	if (in_interrupt())
 		panic("cpufreq_restore() called from interrupt context!");
 
-	if (!kset_get(&cpufreq_interface.kset))
-		return 0;
-
 	if (!try_module_get(cpufreq_driver->owner))
 		goto error_out;
 
@@ -934,8 +898,6 @@
 
 	module_put(cpufreq_driver->owner);
  error_out:
-	kset_put(&cpufreq_interface.kset);
-
 	return ret;
 }
 EXPORT_SYMBOL_GPL(cpufreq_restore);
diff -urN linux-2.5.68-bk9/lib/kobject.c linux-2.5.68-bk10/lib/kobject.c
--- linux-2.5.68-bk9/lib/kobject.c	2003-04-19 19:50:49.000000000 -0700
+++ linux-2.5.68-bk10/lib/kobject.c	2003-04-30 04:34:58.000000000 -0700
@@ -1,5 +1,8 @@
 /*
  * kobject.c - library routines for handling generic kernel objects
+ *
+ * Copyright (c) 2002-2003 Patrick Mochel <mochel@osdl.org>
+ *
  */
 
 #undef DEBUG
@@ -9,6 +12,8 @@
 #include <linux/module.h>
 #include <linux/stat.h>
 
+/* This lock can be removed entirely when the sysfs_init() code is cleaned up
+ * to not try to reference itself before it is initialized. */
 static spinlock_t kobj_lock = SPIN_LOCK_UNLOCKED;
 
 /**
@@ -336,12 +341,14 @@
 struct kobject * kobject_get(struct kobject * kobj)
 {
 	struct kobject * ret = kobj;
-	spin_lock(&kobj_lock);
+	unsigned long flags;
+
+	spin_lock_irqsave(&kobj_lock, flags);
 	if (kobj && atomic_read(&kobj->refcount) > 0)
 		atomic_inc(&kobj->refcount);
 	else
 		ret = NULL;
-	spin_unlock(&kobj_lock);
+	spin_unlock_irqrestore(&kobj_lock, flags);
 	return ret;
 }
 
@@ -371,10 +378,15 @@
 
 void kobject_put(struct kobject * kobj)
 {
-	if (!atomic_dec_and_lock(&kobj->refcount, &kobj_lock))
-		return;
-	spin_unlock(&kobj_lock);
-	kobject_cleanup(kobj);
+	unsigned long flags;
+
+	local_irq_save(flags);
+	if (atomic_dec_and_lock(&kobj->refcount, &kobj_lock)) {
+		spin_unlock_irqrestore(&kobj_lock, flags);
+		kobject_cleanup(kobj);
+	} else {
+		local_irq_restore(flags);
+	}
 }
 
 
diff -urN linux-2.5.68-bk9/net/atm/mpc.c linux-2.5.68-bk10/net/atm/mpc.c
--- linux-2.5.68-bk9/net/atm/mpc.c	2003-04-19 19:50:40.000000000 -0700
+++ linux-2.5.68-bk10/net/atm/mpc.c	2003-04-30 04:34:58.000000000 -0700
@@ -744,7 +744,7 @@
 	.ops	= &mpc_ops,
 	.type	= "mpc",
 	.number	= 42,
-	/* members not explicitely initialised will be 0 */
+	/* members not explicitly initialised will be 0 */
 };
 
 int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
diff -urN linux-2.5.68-bk9/net/atm/resources.c linux-2.5.68-bk10/net/atm/resources.c
--- linux-2.5.68-bk9/net/atm/resources.c	2003-04-19 19:51:10.000000000 -0700
+++ linux-2.5.68-bk10/net/atm/resources.c	2003-04-30 04:34:58.000000000 -0700
@@ -1,4 +1,4 @@
-/* net/atm/resources.c - Staticly allocated resources */
+/* net/atm/resources.c - Statically allocated resources */
 
 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
 
diff -urN linux-2.5.68-bk9/net/ax25/af_ax25.c linux-2.5.68-bk10/net/ax25/af_ax25.c
--- linux-2.5.68-bk9/net/ax25/af_ax25.c	2003-04-19 19:51:07.000000000 -0700
+++ linux-2.5.68-bk10/net/ax25/af_ax25.c	2003-04-30 04:34:58.000000000 -0700
@@ -68,8 +68,6 @@
 	}
 
 	kfree(ax25);
-
-	MOD_DEC_USE_COUNT;
 }
 
 static void ax25_free_sock(struct sock *sk)
@@ -507,8 +505,6 @@
 	if ((ax25 = kmalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL)
 		return NULL;
 
-	MOD_INC_USE_COUNT;
-
 	memset(ax25, 0x00, sizeof(*ax25));
 
 	skb_queue_head_init(&ax25->write_queue);
@@ -1912,6 +1908,7 @@
 static struct net_proto_family ax25_family_ops = {
 	.family =	PF_AX25,
 	.create =	ax25_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct proto_ops ax25_proto_ops = {
diff -urN linux-2.5.68-bk9/net/bluetooth/bnep/core.c linux-2.5.68-bk10/net/bluetooth/bnep/core.c
--- linux-2.5.68-bk9/net/bluetooth/bnep/core.c	2003-04-19 19:50:08.000000000 -0700
+++ linux-2.5.68-bk10/net/bluetooth/bnep/core.c	2003-04-30 04:34:58.000000000 -0700
@@ -536,7 +536,7 @@
 
 	memset(dev->broadcast, 0xff, ETH_ALEN);
 	
-	/* This is rx header therefor addresses are swaped.
+	/* This is rx header therefore addresses are swapped.
 	 * ie eh.h_dest is our local address. */
 	memcpy(s->eh.h_dest,   &src, ETH_ALEN);
 	memcpy(s->eh.h_source, &dst, ETH_ALEN);
diff -urN linux-2.5.68-bk9/net/bluetooth/hci_event.c linux-2.5.68-bk10/net/bluetooth/hci_event.c
--- linux-2.5.68-bk9/net/bluetooth/hci_event.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk10/net/bluetooth/hci_event.c	2003-04-30 04:34:58.000000000 -0700
@@ -520,7 +520,7 @@
 			hci_send_cmd(hdev, OGF_LINK_POLICY, OCF_WRITE_LINK_POLICY, sizeof(cp), &cp);
 		}
 
-		/* Set packet type for incomming connection */
+		/* Set packet type for incoming connection */
 		if (!conn->out) {
 			struct hci_cp_change_conn_ptype cp;
 			cp.handle = ev->handle;
diff -urN linux-2.5.68-bk9/net/bluetooth/l2cap.c linux-2.5.68-bk10/net/bluetooth/l2cap.c
--- linux-2.5.68-bk9/net/bluetooth/l2cap.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bluetooth/l2cap.c	2003-04-30 04:34:58.000000000 -0700
@@ -1039,7 +1039,7 @@
 		sk->state = BT_CONNECTED;
 		sk->state_change(sk);
 	} else {
-		/* Incomming channel.
+		/* Incoming channel.
 		 * Wake up socket sleeping on accept.
 		 */
 		parent->data_ready(parent, 0);
diff -urN linux-2.5.68-bk9/net/bluetooth/rfcomm/core.c linux-2.5.68-bk10/net/bluetooth/rfcomm/core.c
--- linux-2.5.68-bk9/net/bluetooth/rfcomm/core.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bluetooth/rfcomm/core.c	2003-04-30 04:34:58.000000000 -0700
@@ -1067,7 +1067,7 @@
 		return 0;
 	}
 
-	/* Notify socket layer about incomming connection */
+	/* Notify socket layer about incoming connection */
 	channel = __srv_channel(dlci);
 	if (rfcomm_connect_ind(s, channel, &d)) {
 		d->dlci = dlci;
@@ -1150,7 +1150,7 @@
 			return 0;
 		
 		/* PN request for non existing DLC.
-		 * Assume incomming connection. */
+		 * Assume incoming connection. */
 		if (rfcomm_connect_ind(s, channel, &d)) {
 			d->dlci = dlci;
 			d->addr = __addr(s->initiator, dlci);
@@ -1653,7 +1653,7 @@
 	while (!atomic_read(&terminate)) {
 		if (!test_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event)) {
 			/* No pending events. Let's sleep.
-			 * Incomming connections and data will wake us up. */
+			 * Incoming connections and data will wake us up. */
 			set_current_state(TASK_INTERRUPTIBLE);
 			schedule();
 		}
diff -urN linux-2.5.68-bk9/net/bluetooth/rfcomm/tty.c linux-2.5.68-bk10/net/bluetooth/rfcomm/tty.c
--- linux-2.5.68-bk9/net/bluetooth/rfcomm/tty.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bluetooth/rfcomm/tty.c	2003-04-30 04:34:58.000000000 -0700
@@ -899,7 +899,7 @@
 {
 	int i;
 
-	/* Initalize our global data */
+	/* Initialize our global data */
 	for (i = 0; i < RFCOMM_TTY_PORTS; i++)
 		rfcomm_tty_table[i] = NULL;
 
diff -urN linux-2.5.68-bk9/net/bridge/br_fdb.c linux-2.5.68-bk10/net/bridge/br_fdb.c
--- linux-2.5.68-bk9/net/bridge/br_fdb.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/br_fdb.c	2003-04-30 04:34:58.000000000 -0700
@@ -41,15 +41,15 @@
 	return 0;
 }
 
-static __inline__ void copy_fdb(struct __fdb_entry *ent, struct net_bridge_fdb_entry *f)
+static __inline__ void copy_fdb(struct __fdb_entry *ent, 
+				const struct net_bridge_fdb_entry *f)
 {
 	memset(ent, 0, sizeof(struct __fdb_entry));
 	memcpy(ent->mac_addr, f->addr.addr, ETH_ALEN);
 	ent->port_no = f->dst?f->dst->port_no:0;
 	ent->is_local = f->is_local;
-	ent->ageing_timer_value = 0;
-	if (!f->is_static)
-		ent->ageing_timer_value = jiffies - f->ageing_timer;
+	ent->ageing_timer_value = f->is_static ? 0 
+		: ((jiffies - f->ageing_timer) * USER_HZ) / HZ;
 }
 
 static __inline__ int br_mac_hash(unsigned char *mac)
diff -urN linux-2.5.68-bk9/net/bridge/br_ioctl.c linux-2.5.68-bk10/net/bridge/br_ioctl.c
--- linux-2.5.68-bk9/net/bridge/br_ioctl.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/br_ioctl.c	2003-04-30 04:34:58.000000000 -0700
@@ -19,19 +19,22 @@
 #include <asm/uaccess.h>
 #include "br_private.h"
 
+/* import values in USER_HZ  */
+static inline unsigned long user_to_ticks(unsigned long utick)
+{
+	return (utick * HZ) / USER_HZ;
+}
 
-/* Report time remaining in user HZ for compatibility. */
-static inline unsigned long timer_residue(const struct br_timer *timer)
+/* export values in USER_HZ */
+static inline unsigned long ticks_to_user(unsigned long tick)
 {
-	return timer->running 
-		? ((jiffies - timer->expires) * USER_HZ)/HZ 
-		: 0;
+	return (tick * USER_HZ) / HZ;
 }
 
-/* Convert API times in USER_HZ to kernel */
-static inline unsigned long user_to_ticks(unsigned long utick)
+/* Report time remaining in user HZ  */
+static unsigned long timer_residue(const struct br_timer *timer)
 {
-	return (utick * HZ) / USER_HZ;
+	return ticks_to_user(timer->running ? (jiffies - timer->expires) : 0);
 }
 
 static int br_ioctl_device(struct net_bridge *br,
@@ -73,18 +76,18 @@
 		memcpy(&b.designated_root, &br->designated_root, 8);
 		memcpy(&b.bridge_id, &br->bridge_id, 8);
 		b.root_path_cost = br->root_path_cost;
-		b.max_age = br->max_age;
-		b.hello_time = br->hello_time;
+		b.max_age = ticks_to_user(br->max_age);
+		b.hello_time = ticks_to_user(br->hello_time);
 		b.forward_delay = br->forward_delay;
 		b.bridge_max_age = br->bridge_max_age;
 		b.bridge_hello_time = br->bridge_hello_time;
-		b.bridge_forward_delay = br->bridge_forward_delay;
+		b.bridge_forward_delay = ticks_to_user(br->bridge_forward_delay);
 		b.topology_change = br->topology_change;
 		b.topology_change_detected = br->topology_change_detected;
 		b.root_port = br->root_port;
 		b.stp_enabled = br->stp_enabled;
-		b.ageing_time = br->ageing_time;
-		b.gc_interval = br->gc_interval;
+		b.ageing_time = ticks_to_user(br->ageing_time);
+		b.gc_interval = ticks_to_user(br->gc_interval);
 		b.hello_timer_value = timer_residue(&br->hello_timer);
 		b.tcn_timer_value = timer_residue(&br->tcn_timer);
 		b.topology_change_timer_value = timer_residue(&br->topology_change_timer);
diff -urN linux-2.5.68-bk9/net/bridge/br_netfilter.c linux-2.5.68-bk10/net/bridge/br_netfilter.c
--- linux-2.5.68-bk9/net/bridge/br_netfilter.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/br_netfilter.c	2003-04-30 04:34:58.000000000 -0700
@@ -348,10 +348,9 @@
 	if (skb->pkt_type == PACKET_OTHERHOST) {
 		skb->pkt_type = PACKET_HOST;
 		nf_bridge->mask |= BRNF_PKT_TYPE;
-		/* The physdev module checks on this */
-		nf_bridge->mask |= BRNF_BRIDGED;
 	}
 
+	nf_bridge->mask |= BRNF_BRIDGED; /* The physdev module checks on this */
 	nf_bridge->physoutdev = skb->dev;
 
 	NF_HOOK(PF_INET, NF_IP_FORWARD, skb, bridge_parent(nf_bridge->physindev),
@@ -574,15 +573,51 @@
  * ip_refrag() can return NF_STOLEN.
  */
 static struct nf_hook_ops br_nf_ops[] = {
-	{ { NULL, NULL }, br_nf_pre_routing, THIS_MODULE, PF_BRIDGE, NF_BR_PRE_ROUTING, NF_BR_PRI_BRNF },
-	{ { NULL, NULL }, br_nf_local_in, THIS_MODULE, PF_BRIDGE, NF_BR_LOCAL_IN, NF_BR_PRI_BRNF },
-	{ { NULL, NULL }, br_nf_forward, THIS_MODULE, PF_BRIDGE, NF_BR_FORWARD, NF_BR_PRI_BRNF },
-	{ { NULL, NULL }, br_nf_local_out, THIS_MODULE, PF_BRIDGE, NF_BR_LOCAL_OUT, NF_BR_PRI_FIRST },
-	{ { NULL, NULL }, br_nf_post_routing, THIS_MODULE, PF_BRIDGE, NF_BR_POST_ROUTING, NF_BR_PRI_LAST },
-	{ { NULL, NULL }, ipv4_sabotage_in, THIS_MODULE, PF_INET, NF_IP_PRE_ROUTING, NF_IP_PRI_FIRST },
-	{ { NULL, NULL }, ipv4_sabotage_out, THIS_MODULE, PF_INET, NF_IP_FORWARD, NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD },
-	{ { NULL, NULL }, ipv4_sabotage_out, THIS_MODULE, PF_INET, NF_IP_LOCAL_OUT, NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT },
-	{ { NULL, NULL }, ipv4_sabotage_out, THIS_MODULE, PF_INET, NF_IP_POST_ROUTING, NF_IP_PRI_FIRST }
+	{ .hook = br_nf_pre_routing, 
+	  .owner = THIS_MODULE, 
+	  .pf = PF_BRIDGE, 
+	  .hooknum = NF_BR_PRE_ROUTING, 
+	  .priority = NF_BR_PRI_BRNF, },
+	{ .hook = br_nf_local_in,
+	  .owner = THIS_MODULE,
+	  .pf = PF_BRIDGE,
+	  .hooknum = NF_BR_LOCAL_IN,
+	  .priority = NF_BR_PRI_BRNF, },
+	{ .hook = br_nf_forward,
+	  .owner = THIS_MODULE,
+	  .pf = PF_BRIDGE,
+	  .hooknum = NF_BR_FORWARD,
+	  .priority = NF_BR_PRI_BRNF, },
+	{ .hook = br_nf_local_out,
+	  .owner = THIS_MODULE,
+	  .pf = PF_BRIDGE,
+	  .hooknum = NF_BR_LOCAL_OUT,
+	  .priority = NF_BR_PRI_FIRST, },
+	{ .hook = br_nf_post_routing,
+	  .owner = THIS_MODULE,
+	  .pf = PF_BRIDGE,
+	  .hooknum = NF_BR_POST_ROUTING,
+	  .priority = NF_BR_PRI_LAST, },
+	{ .hook = ipv4_sabotage_in,
+	  .owner = THIS_MODULE,
+	  .pf = PF_INET,
+	  .hooknum = NF_IP_PRE_ROUTING,
+	  .priority = NF_IP_PRI_FIRST, },
+	{ .hook = ipv4_sabotage_out,
+	  .owner = THIS_MODULE,
+	  .pf = PF_INET,
+	  .hooknum = NF_IP_FORWARD,
+	  .priority = NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD, },
+	{ .hook = ipv4_sabotage_out,
+	  .owner = THIS_MODULE,
+	  .pf = PF_INET,
+	  .hooknum = NF_IP_LOCAL_OUT,
+	  .priority = NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT, },
+	{ .hook = ipv4_sabotage_out,
+	  .owner = THIS_MODULE,
+	  .pf = PF_INET,
+	  .hooknum = NF_IP_POST_ROUTING,
+	  .priority = NF_IP_PRI_FIRST, },
 };
 
 #define NUMHOOKS (sizeof(br_nf_ops)/sizeof(br_nf_ops[0]))
diff -urN linux-2.5.68-bk9/net/bridge/br_private.h linux-2.5.68-bk10/net/bridge/br_private.h
--- linux-2.5.68-bk9/net/bridge/br_private.h	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/br_private.h	2003-04-30 04:34:58.000000000 -0700
@@ -116,6 +116,13 @@
 extern struct notifier_block br_device_notifier;
 extern unsigned char bridge_ula[6];
 
+/* called under bridge lock */
+static inline int br_is_root_bridge(const struct net_bridge *br)
+{
+	return !memcmp(&br->bridge_id, &br->designated_root, 8);
+}
+
+
 /* br_device.c */
 extern void br_dev_setup(struct net_device *dev);
 extern int br_dev_xmit(struct sk_buff *skb, struct net_device *dev);
@@ -182,7 +189,6 @@
 extern void br_netfilter_fini(void);
 
 /* br_stp.c */
-extern int br_is_root_bridge(struct net_bridge *br);
 extern struct net_bridge_port *br_get_port(struct net_bridge *br,
 				    int port_no);
 extern void br_init_port(struct net_bridge_port *p);
diff -urN linux-2.5.68-bk9/net/bridge/br_private_stp.h linux-2.5.68-bk10/net/bridge/br_private_stp.h
--- linux-2.5.68-bk9/net/bridge/br_private_stp.h	2003-04-19 19:49:56.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/br_private_stp.h	2003-04-30 04:34:58.000000000 -0700
@@ -32,12 +32,18 @@
 	int		forward_delay;
 };
 
+/* called under bridge lock */
+static inline int br_is_designated_port(const struct net_bridge_port *p)
+{
+	return !memcmp(&p->designated_bridge, &p->br->bridge_id, 8) &&
+		(p->designated_port == p->port_id);
+}
+
+
 /* br_stp.c */
 extern void br_become_root_bridge(struct net_bridge *br);
 extern void br_config_bpdu_generation(struct net_bridge *);
 extern void br_configuration_update(struct net_bridge *);
-extern int  br_is_designated_port(struct net_bridge_port *p);
-extern int  br_is_root_bridge(struct net_bridge *br);
 extern void br_port_state_selection(struct net_bridge *);
 extern void br_received_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu);
 extern void br_received_tcn_bpdu(struct net_bridge_port *p);
diff -urN linux-2.5.68-bk9/net/bridge/br_stp.c linux-2.5.68-bk10/net/bridge/br_stp.c
--- linux-2.5.68-bk9/net/bridge/br_stp.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/br_stp.c	2003-04-30 04:34:58.000000000 -0700
@@ -20,27 +20,12 @@
 #include "br_private.h"
 #include "br_private_stp.h"
 
-
-
-/* called under bridge lock */
-int br_is_root_bridge(struct net_bridge *br)
-{
-	return !memcmp(&br->bridge_id, &br->designated_root, 8);
-}
-
-/* called under bridge lock */
-int br_is_designated_port(struct net_bridge_port *p)
-{
-	return !memcmp(&p->designated_bridge, &p->br->bridge_id, 8) &&
-		(p->designated_port == p->port_id);
-}
-
 /* called under bridge lock */
 struct net_bridge_port *br_get_port(struct net_bridge *br, int port_no)
 {
 	struct net_bridge_port *p;
 
-	list_for_each_entry(p, &br->port_list, list) {
+	list_for_each_entry_rcu(p, &br->port_list, list) {
 		if (p->port_no == port_no)
 			return p;
 	}
diff -urN linux-2.5.68-bk9/net/bridge/netfilter/ebt_vlan.c linux-2.5.68-bk10/net/bridge/netfilter/ebt_vlan.c
--- linux-2.5.68-bk9/net/bridge/netfilter/ebt_vlan.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/bridge/netfilter/ebt_vlan.c	2003-04-30 04:34:58.000000000 -0700
@@ -45,7 +45,7 @@
  * Function description: ebt_filter_vlan() is main engine for 
  * checking passed 802.1Q frame according to 
  * the passed extension parameters (in the *data buffer)
- * ebt_filter_vlan() is called after successfull check the rule params
+ * ebt_filter_vlan() is called after successful check the rule params
  * by ebt_check_vlan() function.
  * Parameters:
  * const struct sk_buff *skb - pointer to passed ethernet frame buffer
diff -urN linux-2.5.68-bk9/net/core/dev.c linux-2.5.68-bk10/net/core/dev.c
--- linux-2.5.68-bk9/net/core/dev.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/core/dev.c	2003-04-30 04:34:58.000000000 -0700
@@ -223,9 +223,9 @@
  *
  *	BEWARE!!! Protocol handlers, mangling input packets,
  *	MUST BE last in hash buckets and checking protocol handlers
- *	MUST start from promiscous ptype_all chain in net_bh.
+ *	MUST start from promiscuous ptype_all chain in net_bh.
  *	It is true now, do not change it.
- *	Explantion follows: if protocol handler, mangling packet, will
+ *	Explanation follows: if protocol handler, mangling packet, will
  *	be the first on list, it is not able to sense, that packet
  *	is cloned and should be copied-on-write, so that it will
  *	change it and subsequent readers will get broken packet.
@@ -1434,7 +1434,7 @@
 }
 
 #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE)
-int (*br_handle_frame_hook)(struct sk_buff *skb) = NULL;
+int (*br_handle_frame_hook)(struct sk_buff *skb);
 
 static __inline__ int handle_bridge(struct sk_buff *skb,
 				     struct packet_type *pt_prev)
diff -urN linux-2.5.68-bk9/net/core/dst.c linux-2.5.68-bk10/net/core/dst.c
--- linux-2.5.68-bk9/net/core/dst.c	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk10/net/core/dst.c	2003-04-30 04:34:58.000000000 -0700
@@ -252,9 +252,7 @@
 }
 
 struct notifier_block dst_dev_notifier = {
-	dst_dev_event,
-	NULL,
-	0
+	.notifier_call	= dst_dev_event,
 };
 
 void __init dst_init(void)
diff -urN linux-2.5.68-bk9/net/core/link_watch.c linux-2.5.68-bk10/net/core/link_watch.c
--- linux-2.5.68-bk9/net/core/link_watch.c	2003-04-19 19:48:46.000000000 -0700
+++ linux-2.5.68-bk10/net/core/link_watch.c	2003-04-30 04:34:58.000000000 -0700
@@ -30,8 +30,8 @@
 	LW_SE_USED
 };
 
-static unsigned long linkwatch_flags = 0;
-static unsigned long linkwatch_nextevent = 0;
+static unsigned long linkwatch_flags;
+static unsigned long linkwatch_nextevent;
 
 static void linkwatch_event(void *dummy);
 static DECLARE_WORK(linkwatch_work, linkwatch_event, NULL);
diff -urN linux-2.5.68-bk9/net/core/neighbour.c linux-2.5.68-bk10/net/core/neighbour.c
--- linux-2.5.68-bk9/net/core/neighbour.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk10/net/core/neighbour.c	2003-04-30 04:34:58.000000000 -0700
@@ -1473,141 +1473,141 @@
 } neigh_sysctl_template = {
 	.neigh_vars = {
 		{
-			.ctl_name =	NET_NEIGH_MCAST_SOLICIT,
-			.procname =	"mcast_solicit",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_MCAST_SOLICIT,
+			.procname	= "mcast_solicit",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_UCAST_SOLICIT,
-			.procname =	"ucast_solicit",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_UCAST_SOLICIT,
+			.procname	= "ucast_solicit",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_APP_SOLICIT,
-			.procname =	"app_solicit",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_APP_SOLICIT,
+			.procname	= "app_solicit",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_RETRANS_TIME,
-			.procname =	"retrans_time",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_RETRANS_TIME,
+			.procname	= "retrans_time",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_REACHABLE_TIME,
-			.procname =	"base_reachable_time",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec_jiffies,
+			.ctl_name	= NET_NEIGH_REACHABLE_TIME,
+			.procname	= "base_reachable_time",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec_jiffies,
 		},
 		{
-			.ctl_name =	NET_NEIGH_DELAY_PROBE_TIME,
-			.procname =	"delay_first_probe_time",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec_jiffies,
+			.ctl_name	= NET_NEIGH_DELAY_PROBE_TIME,
+			.procname	= "delay_first_probe_time",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec_jiffies,
 		},
 		{
-			.ctl_name =	NET_NEIGH_GC_STALE_TIME,
-			.procname =	"gc_stale_time",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec_jiffies,
+			.ctl_name	= NET_NEIGH_GC_STALE_TIME,
+			.procname	= "gc_stale_time",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec_jiffies,
 		},
 		{
-			.ctl_name =	NET_NEIGH_UNRES_QLEN,
-			.procname =	"unres_qlen",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_UNRES_QLEN,
+			.procname	= "unres_qlen",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_PROXY_QLEN,
-			.procname =	"proxy_qlen",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_PROXY_QLEN,
+			.procname	= "proxy_qlen",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_ANYCAST_DELAY,
-			.procname =	"anycast_delay",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_ANYCAST_DELAY,
+			.procname	= "anycast_delay",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_PROXY_DELAY,
-			.procname =	"proxy_delay",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_PROXY_DELAY,
+			.procname	= "proxy_delay",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_LOCKTIME,
-			.procname =	"locktime",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_LOCKTIME,
+			.procname	= "locktime",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_GC_INTERVAL,
-			.procname =	"gc_interval",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec_jiffies,
+			.ctl_name	= NET_NEIGH_GC_INTERVAL,
+			.procname	= "gc_interval",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec_jiffies,
 		},
 		{
-			.ctl_name =	NET_NEIGH_GC_THRESH1,
-			.procname =	"gc_thresh1",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_GC_THRESH1,
+			.procname	= "gc_thresh1",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_GC_THRESH2,
-			.procname =	"gc_thresh2",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_GC_THRESH2,
+			.procname	= "gc_thresh2",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 		{
-			.ctl_name =	NET_NEIGH_GC_THRESH3,
-			.procname =	"gc_thresh3",
-			.maxlen =		sizeof(int),
-			.mode =	0644,
-			.proc_handler =&proc_dointvec,
+			.ctl_name	= NET_NEIGH_GC_THRESH3,
+			.procname	= "gc_thresh3",
+			.maxlen		= sizeof(int),
+			.mode		= 0644,
+			.proc_handler	= &proc_dointvec,
 		},
 	},
 	.neigh_dev = {
 		{
-			.ctl_name =	NET_PROTO_CONF_DEFAULT,
-			.procname =	"default",
-			.mode =	0555,
+			.ctl_name	= NET_PROTO_CONF_DEFAULT,
+			.procname	= "default",
+			.mode		= 0555,
 		},
 	},
 	.neigh_neigh_dir = {
 		{
-			.procname =	"neigh",
-			.mode =	0555,
+			.procname	= "neigh",
+			.mode		= 0555,
 		},
 	},
 	.neigh_proto_dir = {
 		{
-			.mode =	0555,
+			.mode		= 0555,
 		},
 	},
 	.neigh_root_dir = {
 		{
-			.ctl_name =	CTL_NET,
-			.procname =	"net",
-			.mode =	0555,
+			.ctl_name	= CTL_NET,
+			.procname	= "net",
+			.mode		= 0555,
 		},
 	},
 };
diff -urN linux-2.5.68-bk9/net/core/netfilter.c linux-2.5.68-bk10/net/core/netfilter.c
--- linux-2.5.68-bk9/net/core/netfilter.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/core/netfilter.c	2003-04-30 04:34:58.000000000 -0700
@@ -19,7 +19,6 @@
 #include <linux/interrupt.h>
 #include <linux/if.h>
 #include <linux/netdevice.h>
-#include <linux/brlock.h>
 #include <linux/inetdevice.h>
 #include <net/sock.h>
 #include <net/route.h>
@@ -40,12 +39,13 @@
 #endif
 
 /* Sockopts only registered and called from user context, so
-   BR_NETPROTO_LOCK would be overkill.  Also, [gs]etsockopt calls may
+   net locking would be overkill.  Also, [gs]etsockopt calls may
    sleep. */
 static DECLARE_MUTEX(nf_sockopt_mutex);
 
 struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS];
 static LIST_HEAD(nf_sockopts);
+static spinlock_t nf_hook_lock = SPIN_LOCK_UNLOCKED;
 
 /* 
  * A queue handler may be registered for each protocol.  Each is protected by
@@ -56,28 +56,31 @@
 	nf_queue_outfn_t outfn;
 	void *data;
 } queue_handler[NPROTO];
+static rwlock_t queue_handler_lock = RW_LOCK_UNLOCKED;
 
 int nf_register_hook(struct nf_hook_ops *reg)
 {
 	struct list_head *i;
 
-	br_write_lock_bh(BR_NETPROTO_LOCK);
-	for (i = nf_hooks[reg->pf][reg->hooknum].next; 
-	     i != &nf_hooks[reg->pf][reg->hooknum]; 
-	     i = i->next) {
+	spin_lock_bh(&nf_hook_lock);
+	list_for_each(i, &nf_hooks[reg->pf][reg->hooknum]) {
 		if (reg->priority < ((struct nf_hook_ops *)i)->priority)
 			break;
 	}
-	list_add(&reg->list, i->prev);
-	br_write_unlock_bh(BR_NETPROTO_LOCK);
+	list_add_rcu(&reg->list, i->prev);
+	spin_unlock_bh(&nf_hook_lock);
+
+	synchronize_net();
 	return 0;
 }
 
 void nf_unregister_hook(struct nf_hook_ops *reg)
 {
-	br_write_lock_bh(BR_NETPROTO_LOCK);
-	list_del(&reg->list);
-	br_write_unlock_bh(BR_NETPROTO_LOCK);
+	spin_lock_bh(&nf_hook_lock);
+	list_del_rcu(&reg->list);
+	spin_unlock_bh(&nf_hook_lock);
+
+	synchronize_net();
 }
 
 /* Do exclusive ranges overlap? */
@@ -344,7 +347,11 @@
 			       int (*okfn)(struct sk_buff *),
 			       int hook_thresh)
 {
-	for (*i = (*i)->next; *i != head; *i = (*i)->next) {
+	/*
+	 * The caller must not block between calls to this
+	 * function because of risk of continuing from deleted element.
+	 */
+	list_for_each_continue_rcu(*i, head) {
 		struct nf_hook_ops *elem = (struct nf_hook_ops *)*i;
 
 		if (hook_thresh > elem->priority)
@@ -383,7 +390,7 @@
 {      
 	int ret;
 
-	br_write_lock_bh(BR_NETPROTO_LOCK);
+	write_lock_bh(&queue_handler_lock);
 	if (queue_handler[pf].outfn)
 		ret = -EBUSY;
 	else {
@@ -391,7 +398,7 @@
 		queue_handler[pf].data = data;
 		ret = 0;
 	}
-	br_write_unlock_bh(BR_NETPROTO_LOCK);
+	write_unlock_bh(&queue_handler_lock);
 
 	return ret;
 }
@@ -399,10 +406,11 @@
 /* The caller must flush their queue before this */
 int nf_unregister_queue_handler(int pf)
 {
-	br_write_lock_bh(BR_NETPROTO_LOCK);
+	write_lock_bh(&queue_handler_lock);
 	queue_handler[pf].outfn = NULL;
 	queue_handler[pf].data = NULL;
-	br_write_unlock_bh(BR_NETPROTO_LOCK);
+	write_unlock_bh(&queue_handler_lock);
+	
 	return 0;
 }
 
@@ -425,7 +433,9 @@
 #endif
 
 	/* QUEUE == DROP if noone is waiting, to be safe. */
+	read_lock(&queue_handler_lock);
 	if (!queue_handler[pf].outfn) {
+		read_unlock(&queue_handler_lock);
 		kfree_skb(skb);
 		return 1;
 	}
@@ -435,6 +445,7 @@
 		if (net_ratelimit())
 			printk(KERN_ERR "OOM queueing packet %p\n",
 			       skb);
+		read_unlock(&queue_handler_lock);
 		kfree_skb(skb);
 		return 1;
 	}
@@ -443,8 +454,11 @@
 		(struct nf_hook_ops *)elem, pf, hook, indev, outdev, okfn };
 
 	/* If it's going away, ignore hook. */
-	if (!try_module_get(info->elem->owner))
+	if (!try_module_get(info->elem->owner)) {
+		read_unlock(&queue_handler_lock);
+		kfree(info);
 		return 0;
+	}
 
 	/* Bump dev refs so they don't vanish while packet is out */
 	if (indev) dev_hold(indev);
@@ -460,6 +474,8 @@
 #endif
 
 	status = queue_handler[pf].outfn(skb, info, queue_handler[pf].data);
+	read_unlock(&queue_handler_lock);
+
 	if (status < 0) {
 		/* James M doesn't say fuck enough. */
 		if (indev) dev_put(indev);
@@ -495,7 +511,7 @@
 	}
 
 	/* We may already have this, but read-locks nest anyway */
-	br_read_lock_bh(BR_NETPROTO_LOCK);
+	rcu_read_lock();
 
 #ifdef CONFIG_NETFILTER_DEBUG
 	if (skb->nf_debug & (1 << hook)) {
@@ -526,7 +542,7 @@
 		break;
 	}
 
-	br_read_unlock_bh(BR_NETPROTO_LOCK);
+	rcu_read_unlock();
 	return ret;
 }
 
@@ -535,12 +551,23 @@
 {
 	struct list_head *elem = &info->elem->list;
 
-	/* We don't have BR_NETPROTO_LOCK here */
-	br_read_lock_bh(BR_NETPROTO_LOCK);
+	rcu_read_lock();
 
 	/* Drop reference to owner of hook which queued us. */
 	module_put(info->elem->owner);
 
+	list_for_each_rcu(i, &nf_hooks[info->pf][info->hook]) {
+		if (i == elem) 
+  			break;
+  	}
+  
+	if (elem == &nf_hooks[info->pf][info->hook]) {
+		/* The module which sent it to userspace is gone. */
+		NFDEBUG("%s: module disappeared, dropping packet.\n",
+			__FUNCTION__);
+		verdict = NF_DROP;
+	}
+
 	/* Continue traversal iff userspace said ok... */
 	if (verdict == NF_REPEAT) {
 		elem = elem->prev;
@@ -570,7 +597,7 @@
 		kfree_skb(skb);
 		break;
 	}
-	br_read_unlock_bh(BR_NETPROTO_LOCK);
+	rcu_read_unlock();
 
 	/* Release those devices we held, or Alexey will kill me. */
 	if (info->indev) dev_put(info->indev);
diff -urN linux-2.5.68-bk9/net/core/pktgen.c linux-2.5.68-bk10/net/core/pktgen.c
--- linux-2.5.68-bk9/net/core/pktgen.c	2003-04-19 19:50:09.000000000 -0700
+++ linux-2.5.68-bk10/net/core/pktgen.c	2003-04-30 04:34:58.000000000 -0700
@@ -198,8 +198,8 @@
 
 /* Module parameters, defaults. */
 static int count_d = 100000;
-static int ipg_d = 0;
-static int clone_skb_d = 0;
+static int ipg_d;
+static int clone_skb_d;
 
 
 #define MAX_PKTGEN 8
@@ -220,7 +220,7 @@
 }
 
 #define PG_PROC_DIR "pktgen"
-static struct proc_dir_entry *proc_dir = 0;
+static struct proc_dir_entry *proc_dir;
 
 static struct net_device *setup_inject(struct pktgen_info* info)
 {
diff -urN linux-2.5.68-bk9/net/core/profile.c linux-2.5.68-bk10/net/core/profile.c
--- linux-2.5.68-bk9/net/core/profile.c	2003-04-19 19:51:17.000000000 -0700
+++ linux-2.5.68-bk10/net/core/profile.c	2003-04-30 04:34:58.000000000 -0700
@@ -160,7 +160,9 @@
 		TIMER_INITIALIZER(whitehole_inject, 0, 0);
 
 static struct net_device whitehole_dev = {
-	"whitehole", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, whitehole_init, };
+	.name	= "whitehole",
+	.init	= whitehole_init,
+};
 
 static int whitehole_open(struct net_device *dev)
 {
diff -urN linux-2.5.68-bk9/net/core/wireless.c linux-2.5.68-bk10/net/core/wireless.c
--- linux-2.5.68-bk9/net/core/wireless.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/core/wireless.c	2003-04-30 04:34:58.000000000 -0700
@@ -66,7 +66,7 @@
 #define WE_STRICT_WRITE		/* Check write buffer size */
 /* I'll probably drop both the define and kernel message in the next version */
 
-/* Debuging stuff */
+/* Debugging stuff */
 #undef WE_IOCTL_DEBUG		/* Debug IOCTL API */
 #undef WE_EVENT_DEBUG		/* Debug Event dispatcher */
 
@@ -1005,7 +1005,7 @@
 /* ---------------------------------------------------------------- */
 /*
  * Main event dispatcher. Called from other parts and drivers.
- * Send the event on the apropriate channels.
+ * Send the event on the appropriate channels.
  * May be called from interrupt context.
  */
 void wireless_send_event(struct net_device *	dev,
diff -urN linux-2.5.68-bk9/net/decnet/af_decnet.c linux-2.5.68-bk10/net/decnet/af_decnet.c
--- linux-2.5.68-bk9/net/decnet/af_decnet.c	2003-04-19 19:49:51.000000000 -0700
+++ linux-2.5.68-bk10/net/decnet/af_decnet.c	2003-04-30 04:34:58.000000000 -0700
@@ -469,24 +469,21 @@
 	skb_queue_purge(&scp->other_receive_queue);
 
 	dst_release(xchg(&sk->dst_cache, NULL));
-
-	MOD_DEC_USE_COUNT;
 }
 
 struct sock *dn_alloc_sock(struct socket *sock, int gfp)
 {
-	struct sock *sk;
 	struct dn_scp *scp;
+	struct sock *sk = sk_alloc(PF_DECnet, gfp, sizeof(struct dn_sock),
+				   dn_sk_cachep);
 
-	if  ((sk = sk_alloc(PF_DECnet, gfp, sizeof(struct dn_sock), dn_sk_cachep)) == NULL) 
-		goto no_sock;
+	if  (!sk)
+		goto out;
 
-	scp = (struct dn_scp *)(sk + 1);
-	DN_SK(sk) = scp;
+	DN_SK(sk) = scp = (struct dn_scp *)(sk + 1);
 
-	if (sock) {
-			sock->ops = &dn_proto_ops;
-	}
+	if (sock)
+		sock->ops = &dn_proto_ops;
 	sock_init_data(sock, sk);
 
 	sk->backlog_rcv = dn_nsp_backlog_rcv;
@@ -543,13 +540,8 @@
 	scp->delack_fxn = dn_nsp_delayed_ack;
 
 	dn_start_slow_timer(sk);
-
-	MOD_INC_USE_COUNT;
-
+out:
 	return sk;
-
-no_sock:
-	return NULL;
 }
 
 /*
@@ -2238,6 +2230,7 @@
 static struct net_proto_family	dn_family_ops = {
 	.family =	AF_DECnet,
 	.create =	dn_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct proto_ops dn_proto_ops = {
@@ -2304,7 +2297,7 @@
 	 * Requires an audit of the code to check for memory leaks and
 	 * initialisation problems etc.
 	 */
-	MOD_INC_USE_COUNT;
+	try_module_get(THIS_MODULE);
 
 	return 0;
 
diff -urN linux-2.5.68-bk9/net/decnet/dn_nsp_out.c linux-2.5.68-bk10/net/decnet/dn_nsp_out.c
--- linux-2.5.68-bk9/net/decnet/dn_nsp_out.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk10/net/decnet/dn_nsp_out.c	2003-04-30 04:34:58.000000000 -0700
@@ -642,7 +642,7 @@
 	}
 
 	/*
-	 * This doesn't go via the dn_nsp_send() fucntion since we need
+	 * This doesn't go via the dn_nsp_send() function since we need
 	 * to be able to send disc packets out which have no socket
 	 * associations.
 	 */
diff -urN linux-2.5.68-bk9/net/econet/af_econet.c linux-2.5.68-bk10/net/econet/af_econet.c
--- linux-2.5.68-bk9/net/econet/af_econet.c	2003-04-19 19:49:30.000000000 -0700
+++ linux-2.5.68-bk10/net/econet/af_econet.c	2003-04-30 04:34:58.000000000 -0700
@@ -502,7 +502,6 @@
 
 	if (!atomic_read(&sk->wmem_alloc) && !atomic_read(&sk->rmem_alloc)) {
 		sk_free(sk);
-		MOD_DEC_USE_COUNT;
 		return;
 	}
 
@@ -547,7 +546,6 @@
 	}
 
 	sk_free(sk);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -566,7 +564,6 @@
 		return -ESOCKTNOSUPPORT;
 
 	sock->state = SS_UNCONNECTED;
-	MOD_INC_USE_COUNT;
 
 	err = -ENOBUFS;
 	sk = sk_alloc(PF_ECONET, GFP_KERNEL, 1, NULL);
@@ -591,7 +588,6 @@
 out_free:
 	sk_free(sk);
 out:
-	MOD_DEC_USE_COUNT;
 	return err;
 }
 
@@ -693,6 +689,7 @@
 static struct net_proto_family econet_family_ops = {
 	.family =	PF_ECONET,
 	.create =	econet_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
diff -urN linux-2.5.68-bk9/net/ipv4/fib_semantics.c linux-2.5.68-bk10/net/ipv4/fib_semantics.c
--- linux-2.5.68-bk9/net/ipv4/fib_semantics.c	2003-04-19 19:48:53.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/fib_semantics.c	2003-04-30 04:34:58.000000000 -0700
@@ -83,23 +83,62 @@
 {
 	int	error;
 	u8	scope;
-} fib_props[RTA_MAX+1] = {
-        { 0, RT_SCOPE_NOWHERE},		/* RTN_UNSPEC */
-	{ 0, RT_SCOPE_UNIVERSE},	/* RTN_UNICAST */
-	{ 0, RT_SCOPE_HOST},		/* RTN_LOCAL */
-	{ 0, RT_SCOPE_LINK},		/* RTN_BROADCAST */
-	{ 0, RT_SCOPE_LINK},		/* RTN_ANYCAST */
-	{ 0, RT_SCOPE_UNIVERSE},	/* RTN_MULTICAST */
-	{ -EINVAL, RT_SCOPE_UNIVERSE},	/* RTN_BLACKHOLE */
-	{ -EHOSTUNREACH, RT_SCOPE_UNIVERSE},/* RTN_UNREACHABLE */
-	{ -EACCES, RT_SCOPE_UNIVERSE},	/* RTN_PROHIBIT */
-	{ -EAGAIN, RT_SCOPE_UNIVERSE},	/* RTN_THROW */
+} fib_props[RTA_MAX + 1] = {
+        {
+		.error	= 0,
+		.scope	= RT_SCOPE_NOWHERE,
+	},	/* RTN_UNSPEC */
+	{
+		.error	= 0,
+		.scope	= RT_SCOPE_UNIVERSE,
+	},	/* RTN_UNICAST */
+	{
+		.error	= 0,
+		.scope	= RT_SCOPE_HOST,
+	},	/* RTN_LOCAL */
+	{
+		.error	= 0,
+		.scope	= RT_SCOPE_LINK,
+	},	/* RTN_BROADCAST */
+	{
+		.error	= 0,
+		.scope	= RT_SCOPE_LINK,
+	},	/* RTN_ANYCAST */
+	{
+		.error	= 0,
+		.scope	= RT_SCOPE_UNIVERSE,
+	},	/* RTN_MULTICAST */
+	{
+		.error	= -EINVAL,
+		.scope	= RT_SCOPE_UNIVERSE,
+	},	/* RTN_BLACKHOLE */
+	{
+		.error	= -EHOSTUNREACH,
+		.scope	= RT_SCOPE_UNIVERSE,
+	},	/* RTN_UNREACHABLE */
+	{
+		.error	= -EACCES,
+		.scope	= RT_SCOPE_UNIVERSE,
+	},	/* RTN_PROHIBIT */
+	{
+		.error	= -EAGAIN,
+		.scope	= RT_SCOPE_UNIVERSE,
+	},	/* RTN_THROW */
 #ifdef CONFIG_IP_ROUTE_NAT
-	{ 0, RT_SCOPE_HOST},		/* RTN_NAT */
+	{
+		.error	= 0,
+		.scope	= RT_SCOPE_HOST,
+	},	/* RTN_NAT */
 #else
-	{ -EINVAL, RT_SCOPE_NOWHERE},	/* RTN_NAT */
-#endif
-	{ -EINVAL, RT_SCOPE_NOWHERE}	/* RTN_XRESOLVE */
+	{
+		.error	= -EINVAL,
+		.scope	= RT_SCOPE_NOWHERE,
+	},	/* RTN_NAT */
+#endif
+	{
+		.error	= -EINVAL,
+		.scope	= RT_SCOPE_NOWHERE,
+	},	/* RTN_XRESOLVE */
 };
 
 
@@ -317,7 +356,7 @@
    Attempt to reconcile all of these (alas, self-contradictory) conditions
    results in pretty ugly and hairy code with obscure logic.
 
-   I choosed to generalized it instead, so that the size
+   I chose to generalized it instead, so that the size
    of code does not increase practically, but it becomes
    much more general.
    Every prefix is assigned a "scope" value: "host" is local address,
diff -urN linux-2.5.68-bk9/net/ipv4/ip_gre.c linux-2.5.68-bk10/net/ipv4/ip_gre.c
--- linux-2.5.68-bk9/net/ipv4/ip_gre.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/ip_gre.c	2003-04-30 04:34:58.000000000 -0700
@@ -159,7 +159,7 @@
 
 static rwlock_t ipgre_lock = RW_LOCK_UNLOCKED;
 
-/* Given src, dst and key, find approriate for input tunnel. */
+/* Given src, dst and key, find appropriate for input tunnel. */
 
 static struct ip_tunnel * ipgre_tunnel_lookup(u32 remote, u32 local, u32 key)
 {
diff -urN linux-2.5.68-bk9/net/ipv4/ip_output.c linux-2.5.68-bk10/net/ipv4/ip_output.c
--- linux-2.5.68-bk9/net/ipv4/ip_output.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/ip_output.c	2003-04-30 04:34:58.000000000 -0700
@@ -86,7 +86,7 @@
  *      Shall we try to damage output packets if routing dev changes?
  */
 
-int sysctl_ip_dynaddr = 0;
+int sysctl_ip_dynaddr;
 int sysctl_ip_default_ttl = IPDEFTTL;
 
 /* Generate a checksum for an outgoing IP datagram. */
diff -urN linux-2.5.68-bk9/net/ipv4/ip_sockglue.c linux-2.5.68-bk10/net/ipv4/ip_sockglue.c
--- linux-2.5.68-bk9/net/ipv4/ip_sockglue.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/ip_sockglue.c	2003-04-30 04:34:58.000000000 -0700
@@ -177,7 +177,7 @@
 }
 
 
-/* Special input handler for packets catched by router alert option.
+/* Special input handler for packets caught by router alert option.
    They are selected only by protocol field, and then processed likely
    local ones; but only if someone wants them! Otherwise, router
    not running rsvpd will kill RSVP.
diff -urN linux-2.5.68-bk9/net/ipv4/ipconfig.c linux-2.5.68-bk10/net/ipv4/ipconfig.c
--- linux-2.5.68-bk9/net/ipv4/ipconfig.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/ipconfig.c	2003-04-30 04:34:58.000000000 -0700
@@ -27,7 +27,7 @@
  *  Merged changes from 2.2.19 into 2.4.3
  *              -- Eric Biederman <ebiederman@lnxi.com>, 22 April Aug 2001
  *
- *  Multipe Nameservers in /proc/net/pnp
+ *  Multiple Nameservers in /proc/net/pnp
  *              --  Josef Siemes <jsiemes@web.de>, Aug 2002
  */
 
diff -urN linux-2.5.68-bk9/net/ipv4/netfilter/ip_fw_compat_masq.c linux-2.5.68-bk10/net/ipv4/netfilter/ip_fw_compat_masq.c
--- linux-2.5.68-bk9/net/ipv4/netfilter/ip_fw_compat_masq.c	2003-04-19 19:50:36.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/netfilter/ip_fw_compat_masq.c	2003-04-30 04:34:58.000000000 -0700
@@ -1,7 +1,7 @@
 /* Masquerading compatibility layer.
 
    Note that there are no restrictions on other programs binding to
-   ports 61000:65095 (in 2.0 and 2.2 they get EADDRINUSE).  Just DONT
+   ports 61000:65095 (in 2.0 and 2.2 they get EADDRINUSE).  Just DON'T
    DO IT.
  */
 #include <linux/skbuff.h>
diff -urN linux-2.5.68-bk9/net/ipv4/netfilter/ipfwadm_core.c linux-2.5.68-bk10/net/ipv4/netfilter/ipfwadm_core.c
--- linux-2.5.68-bk9/net/ipv4/netfilter/ipfwadm_core.c	2003-04-19 19:49:12.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/netfilter/ipfwadm_core.c	2003-04-30 04:34:58.000000000 -0700
@@ -505,7 +505,7 @@
 		   It will not affect performance if you will follow
 		   the following simple rules:
 
-		   - if inteface is aliased, ALWAYS specify fw_viadev,
+		   - if interface is aliased, ALWAYS specify fw_viadev,
 		     so that previous check will guarantee, that we will
 		     not waste time when packet arrive on another interface.
 
diff -urN linux-2.5.68-bk9/net/ipv4/route.c linux-2.5.68-bk10/net/ipv4/route.c
--- linux-2.5.68-bk9/net/ipv4/route.c	2003-04-19 19:51:14.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/route.c	2003-04-30 04:34:58.000000000 -0700
@@ -44,7 +44,7 @@
  *		Alan Cox	:	Multicast fixed (I hope)
  * 		Pavel Krauz	:	Limited broadcast fixed
  *		Mike McLagan	:	Routing by source
- *	Alexey Kuznetsov	:	End of old history. Splitted to fib.c and
+ *	Alexey Kuznetsov	:	End of old history. Split to fib.c and
  *					route.c and rewritten from scratch.
  *		Andi Kleen	:	Load-limit warning messages.
  *	Vitaly E. Lavrov	:	Transparent proxy revived after year coma.
diff -urN linux-2.5.68-bk9/net/ipv4/tcp_input.c linux-2.5.68-bk10/net/ipv4/tcp_input.c
--- linux-2.5.68-bk9/net/ipv4/tcp_input.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/tcp_input.c	2003-04-30 04:34:58.000000000 -0700
@@ -78,16 +78,16 @@
 #ifdef CONFIG_INET_ECN
 int sysctl_tcp_ecn = 1;
 #else
-int sysctl_tcp_ecn = 0;
+int sysctl_tcp_ecn;
 #endif
 int sysctl_tcp_dsack = 1;
 int sysctl_tcp_app_win = 31;
 int sysctl_tcp_adv_win_scale = 2;
 
-int sysctl_tcp_stdurg = 0;
-int sysctl_tcp_rfc1337 = 0;
+int sysctl_tcp_stdurg;
+int sysctl_tcp_rfc1337;
 int sysctl_tcp_max_orphans = NR_FILE;
-int sysctl_tcp_frto = 0;
+int sysctl_tcp_frto;
 
 #define FLAG_DATA		0x01 /* Incoming frame contained data.		*/
 #define FLAG_WIN_UPDATE		0x02 /* Incoming ACK was a window update.	*/
diff -urN linux-2.5.68-bk9/net/ipv4/tcp_ipv4.c linux-2.5.68-bk10/net/ipv4/tcp_ipv4.c
--- linux-2.5.68-bk9/net/ipv4/tcp_ipv4.c	2003-04-19 19:48:58.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/tcp_ipv4.c	2003-04-30 04:34:58.000000000 -0700
@@ -838,7 +838,7 @@
 	/* Socket identity is still unknown (sport may be zero).
 	 * However we set state to SYN-SENT and not releasing socket
 	 * lock select source port, enter ourselves into the hash tables and
-	 * complete initalization after this.
+	 * complete initialization after this.
 	 */
 	tcp_set_state(sk, TCP_SYN_SENT);
 	err = tcp_v4_hash_connect(sk);
diff -urN linux-2.5.68-bk9/net/ipv4/tcp_minisocks.c linux-2.5.68-bk10/net/ipv4/tcp_minisocks.c
--- linux-2.5.68-bk9/net/ipv4/tcp_minisocks.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/tcp_minisocks.c	2003-04-30 04:34:58.000000000 -0700
@@ -33,11 +33,11 @@
 #define SYNC_INIT 1
 #endif
 
-int sysctl_tcp_tw_recycle = 0;
+int sysctl_tcp_tw_recycle;
 int sysctl_tcp_max_tw_buckets = NR_FILE*2;
 
 int sysctl_tcp_syncookies = SYNC_INIT; 
-int sysctl_tcp_abort_on_overflow = 0;
+int sysctl_tcp_abort_on_overflow;
 
 static __inline__ int tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win)
 {
@@ -50,7 +50,7 @@
 
 /* New-style handling of TIME_WAIT sockets. */
 
-int tcp_tw_count = 0;
+int tcp_tw_count;
 
 
 /* Must be called with locally disabled BHs. */
diff -urN linux-2.5.68-bk9/net/ipv4/tcp_output.c linux-2.5.68-bk10/net/ipv4/tcp_output.c
--- linux-2.5.68-bk9/net/ipv4/tcp_output.c	2003-04-19 19:50:08.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv4/tcp_output.c	2003-04-30 04:34:58.000000000 -0700
@@ -79,7 +79,7 @@
  *    large MSS.
  * 4. We do not make 3, we advertise MSS, calculated from first
  *    hop device mtu, but allow to raise it to ip_rt_min_advmss.
- *    This may be overriden via information stored in routing table.
+ *    This may be overridden via information stored in routing table.
  * 5. Value 65535 for MSS is valid in IPv6 and means "as large as possible,
  *    probably even Jumbo".
  */
diff -urN linux-2.5.68-bk9/net/ipv6/addrconf.c linux-2.5.68-bk10/net/ipv6/addrconf.c
--- linux-2.5.68-bk9/net/ipv6/addrconf.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/addrconf.c	2003-04-30 04:34:58.000000000 -0700
@@ -132,45 +132,43 @@
 
 static struct notifier_block *inet6addr_chain;
 
-struct ipv6_devconf ipv6_devconf =
-{
-	0,				/* forwarding		*/
-	IPV6_DEFAULT_HOPLIMIT,		/* hop limit		*/
-	IPV6_MIN_MTU,			/* mtu			*/
-	1,				/* accept RAs		*/
-	1,				/* accept redirects	*/
-	1,				/* autoconfiguration	*/
-	1,				/* dad transmits	*/
-	MAX_RTR_SOLICITATIONS,		/* router solicits	*/
-	RTR_SOLICITATION_INTERVAL,	/* rtr solicit interval	*/
-	MAX_RTR_SOLICITATION_DELAY,	/* rtr solicit delay	*/
-#ifdef CONFIG_IPV6_PRIVACY
-	.use_tempaddr 			= 0,
-	.temp_valid_lft			= TEMP_VALID_LIFETIME,
-	.temp_prefered_lft		= TEMP_PREFERRED_LIFETIME,
-	.regen_max_retry		= REGEN_MAX_RETRY,
-	.max_desync_factor		= MAX_DESYNC_FACTOR,
+struct ipv6_devconf ipv6_devconf = {
+	.forwarding		= 0,
+	.hop_limit		= IPV6_DEFAULT_HOPLIMIT,
+	.mtu6			= IPV6_MIN_MTU,
+	.accept_ra		= 1,
+	.accept_redirects	= 1,
+	.autoconf		= 1,
+	.dad_transmits		= 1,
+	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
+	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
+	.rtr_solicit_delay	= MAX_RTR_SOLICITATION_DELAY,
+#ifdef CONFIG_IPV6_PRIVACY
+	.use_tempaddr 		= 0,
+	.temp_valid_lft		= TEMP_VALID_LIFETIME,
+	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
+	.regen_max_retry	= REGEN_MAX_RETRY,
+	.max_desync_factor	= MAX_DESYNC_FACTOR,
 #endif
 };
 
-static struct ipv6_devconf ipv6_devconf_dflt =
-{
-	0,				/* forwarding		*/
-	IPV6_DEFAULT_HOPLIMIT,		/* hop limit		*/
-	IPV6_MIN_MTU,			/* mtu			*/
-	1,				/* accept RAs		*/
-	1,				/* accept redirects	*/
-	1,				/* autoconfiguration	*/
-	1,				/* dad transmits	*/
-	MAX_RTR_SOLICITATIONS,		/* router solicits	*/
-	RTR_SOLICITATION_INTERVAL,	/* rtr solicit interval	*/
-	MAX_RTR_SOLICITATION_DELAY,	/* rtr solicit delay	*/
-#ifdef CONFIG_IPV6_PRIVACY
-	.use_tempaddr			= 0,
-	.temp_valid_lft			= TEMP_VALID_LIFETIME,
-	.temp_prefered_lft		= TEMP_PREFERRED_LIFETIME,
-	.regen_max_retry		= REGEN_MAX_RETRY,
-	.max_desync_factor		= MAX_DESYNC_FACTOR,
+static struct ipv6_devconf ipv6_devconf_dflt = {
+	.forwarding		= 0,
+	.hop_limit		= IPV6_DEFAULT_HOPLIMIT,
+	.mtu6			= IPV6_MIN_MTU,
+	.accept_ra		= 1,
+	.accept_redirects	= 1,
+	.autoconf		= 1,
+	.dad_transmits		= 1,
+	.rtr_solicits		= MAX_RTR_SOLICITATIONS,
+	.rtr_solicit_interval	= RTR_SOLICITATION_INTERVAL,
+	.rtr_solicit_delay	= MAX_RTR_SOLICITATION_DELAY,
+#ifdef CONFIG_IPV6_PRIVACY
+	.use_tempaddr		= 0,
+	.temp_valid_lft		= TEMP_VALID_LIFETIME,
+	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
+	.regen_max_retry	= REGEN_MAX_RETRY,
+	.max_desync_factor	= MAX_DESYNC_FACTOR,
 #endif
 };
 
@@ -747,9 +745,9 @@
 #endif
 
 /*
- *	Choose an apropriate source address
+ *	Choose an appropriate source address
  *	should do:
- *	i)	get an address with an apropriate scope
+ *	i)	get an address with an appropriate scope
  *	ii)	see if there is a specific route for the destination and use
  *		an address of the attached interface 
  *	iii)	don't use deprecated addresses
diff -urN linux-2.5.68-bk9/net/ipv6/exthdrs.c linux-2.5.68-bk10/net/ipv6/exthdrs.c
--- linux-2.5.68-bk9/net/ipv6/exthdrs.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/exthdrs.c	2003-04-30 04:34:58.000000000 -0700
@@ -19,7 +19,7 @@
  *	yoshfuji		: ensure not to overrun while parsing 
  *				  tlv options.
  *	Mitsuru KANDA @USAGI and: Remove ipv6_parse_exthdrs().
- *	YOSHIFUJI Hideaki @USAGI  Register inbound extention header
+ *	YOSHIFUJI Hideaki @USAGI  Register inbound extension header
  *				  handlers as inet6_protocol{}.
  */
 
@@ -344,7 +344,7 @@
    this stupid requirement making rthdr idea useless)
 
    Actually, it creates severe problems  for us.
-   Embrionic requests has no associated sockets,
+   Embryonic requests has no associated sockets,
    so that user have no control over it and
    cannot not only to set reply options, but
    even to know, that someone wants to connect
diff -urN linux-2.5.68-bk9/net/ipv6/icmp.c linux-2.5.68-bk10/net/ipv6/icmp.c
--- linux-2.5.68-bk9/net/ipv6/icmp.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/icmp.c	2003-04-30 04:34:58.000000000 -0700
@@ -602,7 +602,7 @@
 			break;
 
 		/* 
-		 * error of unkown type. 
+		 * error of unknown type. 
 		 * must pass to upper level 
 		 */
 
diff -urN linux-2.5.68-bk9/net/ipv6/ip6_fib.c linux-2.5.68-bk10/net/ipv6/ip6_fib.c
--- linux-2.5.68-bk9/net/ipv6/ip6_fib.c	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/ip6_fib.c	2003-04-30 04:34:58.000000000 -0700
@@ -232,7 +232,7 @@
 /*
  *	Routing Table
  *
- *	return the apropriate node for a routing tree "add" operation
+ *	return the appropriate node for a routing tree "add" operation
  *	by either creating and inserting or by returning an existing
  *	node.
  */
@@ -697,7 +697,7 @@
 }
 
 /*
- *	Get node with sepciafied destination prefix (and source prefix,
+ *	Get node with specified destination prefix (and source prefix,
  *	if subtrees are used)
  */
 
diff -urN linux-2.5.68-bk9/net/ipv6/ip6_output.c linux-2.5.68-bk10/net/ipv6/ip6_output.c
--- linux-2.5.68-bk9/net/ipv6/ip6_output.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/ip6_output.c	2003-04-30 04:34:58.000000000 -0700
@@ -263,7 +263,7 @@
  *	To avoid extra problems ND packets are send through this
  *	routine. It's code duplication but I really want to avoid
  *	extra checks since ipv6_build_header is used by TCP (which
- *	is for us performace critical)
+ *	is for us performance critical)
  */
 
 int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev,
diff -urN linux-2.5.68-bk9/net/ipv6/mcast.c linux-2.5.68-bk10/net/ipv6/mcast.c
--- linux-2.5.68-bk9/net/ipv6/mcast.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/mcast.c	2003-04-30 04:34:58.000000000 -0700
@@ -2104,7 +2104,7 @@
 
 		for (imc=idev->mc_list; imc; imc=imc->next) {
 			struct ip6_sf_list *psf;
-			unsigned long icount, xcount, i;
+			unsigned long i;
 
 			spin_lock_bh(&imc->mca_lock);
 			for (psf=imc->mca_sources; psf; psf=psf->sf_next) {
diff -urN linux-2.5.68-bk9/net/ipv6/ndisc.c linux-2.5.68-bk10/net/ipv6/ndisc.c
--- linux-2.5.68-bk9/net/ipv6/ndisc.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/ndisc.c	2003-04-30 04:34:58.000000000 -0700
@@ -807,7 +807,7 @@
 
 			/* 
 			 *	update / create cache entry
-			 *	for the source adddress
+			 *	for the source address
 			 */
 
 			neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, dev);
@@ -852,7 +852,7 @@
 	
 			/*
 			 *   update / create cache entry
-			 *   for the source adddress
+			 *   for the source address
 			 */
 
 			neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, skb->dev);
diff -urN linux-2.5.68-bk9/net/ipv6/udp.c linux-2.5.68-bk10/net/ipv6/udp.c
--- linux-2.5.68-bk9/net/ipv6/udp.c	2003-04-19 19:50:40.000000000 -0700
+++ linux-2.5.68-bk10/net/ipv6/udp.c	2003-04-30 04:34:58.000000000 -0700
@@ -378,7 +378,7 @@
 
 	ip6_dst_store(sk, dst, fl.fl6_dst);
 
-	/* get the source adddress used in the apropriate device */
+	/* get the source address used in the appropriate device */
 
 	err = ipv6_get_saddr(dst, daddr, &saddr);
 
diff -urN linux-2.5.68-bk9/net/ipx/af_ipx.c linux-2.5.68-bk10/net/ipx/af_ipx.c
--- linux-2.5.68-bk9/net/ipx/af_ipx.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/ipx/af_ipx.c	2003-04-30 04:34:58.000000000 -0700
@@ -415,7 +415,7 @@
 	int is_broadcast = !memcmp(ipx->ipx_dest.node, ipx_broadcast_node,
 				   IPX_NODE_LEN);
 	struct sock *s;
-	int ret;
+	int rc;
 
 	spin_lock_bh(&intrfc->if_sklist_lock);
 	s = intrfc->if_sklist;
@@ -431,7 +431,7 @@
 
 			if (copy) {
 				skb1 = skb_clone(skb, GFP_ATOMIC);
-				ret = -ENOMEM;
+				rc = -ENOMEM;
 				if (!skb1)
 					goto out;
 			} else {
@@ -451,10 +451,10 @@
 	if (!copy)
 		kfree_skb(skb);
 
-	ret = 0;
+	rc = 0;
 out:
 	spin_unlock_bh(&intrfc->if_sklist_lock);
-	return ret;
+	return rc;
 }
 #else
 static struct sock *ncp_connection_hack(struct ipx_interface *intrfc,
@@ -497,7 +497,7 @@
 	struct ipxhdr *ipx = ipx_hdr(skb);
 	struct sock *sock1 = NULL, *sock2 = NULL;
 	struct sk_buff *skb1 = NULL, *skb2 = NULL;
-	int ret;
+	int rc;
 
 	if (intrfc == ipx_primary_net && ntohs(ipx->ipx_dest.sock) == 0x451)
 		sock1 = ncp_connection_hack(intrfc, ipx);
@@ -528,10 +528,11 @@
 	/*
 	 * If there is nothing to do return. The kfree will cancel any charging.
 	 */
+	rc = 0;
 	if (!sock1 && !sock2) {
 		if (!copy)
 			kfree_skb(skb);
-		return 0;
+		goto out;
 	}
 
 	/*
@@ -547,9 +548,9 @@
 	else
 		skb1 = skb;
 
-	ret = -ENOMEM;
+	rc = -ENOMEM;
 	if (!skb1)
-		goto out;
+		goto out_put;
 
 	/* Do we need 2 SKBs? */
 	if (sock1 && sock2)
@@ -560,20 +561,20 @@
 	if (sock1)
 		ipxitf_def_skb_handler(sock1, skb1);
 
-	ret = -ENOMEM;
 	if (!skb2)
-		goto out;
+		goto out_put;
 
 	if (sock2)
 		ipxitf_def_skb_handler(sock2, skb2);
 
-	ret = 0;
-out:
+	rc = 0;
+out_put:
 	if (sock1)
 		sock_put(sock1);
 	if (sock2)
 		sock_put(sock2);
-	return ret;
+out:
+	return rc;
 }
 #endif	/* CONFIG_IPX_INTERN */
 
@@ -727,7 +728,7 @@
 static int ipxitf_rcv(struct ipx_interface *intrfc, struct sk_buff *skb)
 {
 	struct ipxhdr *ipx = ipx_hdr(skb);
-	int ret = 0;
+	int rc = 0;
 
 	ipxitf_hold(intrfc);
 
@@ -737,8 +738,8 @@
 	
 	IPX_SKB_CB(skb)->last_hop.index = -1;
 	if (ipx->ipx_type == IPX_TYPE_PPROP) {
-		ret = ipxitf_pprop(intrfc, skb);
-		if (ret)
+		rc = ipxitf_pprop(intrfc, skb);
+		if (rc)
 			goto out_free_skb;
 	}
 
@@ -756,7 +757,7 @@
 		if (skb->pkt_type == PACKET_HOST) {
 			skb = skb_unshare(skb, GFP_ATOMIC);
 			if (skb)
-				ret = ipxrtr_route_skb(skb);
+				rc = ipxrtr_route_skb(skb);
 			goto out_intrfc;
 		}
 
@@ -766,7 +767,7 @@
 	/* see if we should keep it */
 	if (!memcmp(ipx_broadcast_node, ipx->ipx_dest.node, IPX_NODE_LEN) ||
 	    !memcmp(intrfc->if_node, ipx->ipx_dest.node, IPX_NODE_LEN)) {
-		ret = ipxitf_demux_socket(intrfc, skb, 0);
+		rc = ipxitf_demux_socket(intrfc, skb, 0);
 		goto out_intrfc;
 	}
 
@@ -775,7 +776,7 @@
 	kfree_skb(skb);
 out_intrfc:
 	ipxitf_put(intrfc);
-	return ret;
+	return rc;
 }
 
 static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
@@ -833,7 +834,7 @@
 static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
 {
 	struct ipxhdr *ipx = ipx_hdr(skb);
-	int i, ret = -EINVAL;
+	int i, rc = -EINVAL;
 	struct ipx_interface *ifcs;
 	char *c;
 	u32 *l;
@@ -847,7 +848,7 @@
 	    				IPX_MAX_PPROP_HOPS * sizeof(u32))
 		goto out;
 	/* are we broadcasting this damn thing? */
-	ret = 0;
+	rc = 0;
 	if (!sysctl_ipx_pprop_broadcasting)
 		goto out;
 	/* We do broadcast packet on the IPX_MAX_PPROP_HOPS hop, but we
@@ -896,7 +897,7 @@
 	}
 	spin_unlock_bh(&ipx_interfaces_lock);
 out:
-	return ret;
+	return rc;
 }
 
 static void ipxitf_insert(struct ipx_interface *intrfc)
@@ -944,24 +945,24 @@
 static int ipxitf_create_internal(struct ipx_interface_definition *idef)
 {
 	struct ipx_interface *intrfc;
-	int ret = -EEXIST;
+	int rc = -EEXIST;
 
 	/* Only one primary network allowed */
 	if (ipx_primary_net)
 		goto out;
 
 	/* Must have a valid network number */
-	ret = -EADDRNOTAVAIL;
+	rc = -EADDRNOTAVAIL;
 	if (!idef->ipx_network)
 		goto out;
 	intrfc = ipxitf_find_using_net(idef->ipx_network);
-	ret = -EADDRINUSE;
+	rc = -EADDRINUSE;
 	if (intrfc) {
 		ipxitf_put(intrfc);
 		goto out;
 	}
 	intrfc = ipxitf_alloc(NULL, idef->ipx_network, 0, NULL, 1, 0);
-	ret = -EAGAIN;
+	rc = -EAGAIN;
 	if (!intrfc)
 		goto out;
 	memcpy((char *)&(intrfc->if_node), idef->ipx_node, IPX_NODE_LEN);
@@ -969,28 +970,24 @@
 	ipxitf_hold(intrfc);
 	ipxitf_insert(intrfc);
 
-	ret = ipxitf_add_local_route(intrfc);
+	rc = ipxitf_add_local_route(intrfc);
 	ipxitf_put(intrfc);
 out:
-	return ret;
+	return rc;
 }
 
 static int ipx_map_frame_type(unsigned char type)
 {
-	int ret = 0;
+	int rc = 0;
 
 	switch (type) {
-		case IPX_FRAME_ETHERII:
-			ret = htons(ETH_P_IPX);		break;
-		case IPX_FRAME_8022:
-			ret = htons(ETH_P_802_2);	break;
-		case IPX_FRAME_SNAP:
-			ret = htons(ETH_P_SNAP);	break;
-		case IPX_FRAME_8023:
-			ret = htons(ETH_P_802_3);	break;
+	case IPX_FRAME_ETHERII:	rc = htons(ETH_P_IPX);		break;
+	case IPX_FRAME_8022:	rc = htons(ETH_P_802_2);	break;
+	case IPX_FRAME_SNAP:	rc = htons(ETH_P_SNAP);		break;
+	case IPX_FRAME_8023:	rc = htons(ETH_P_802_3);	break;
 	}
 
-	return ret;
+	return rc;
 }
 
 static int ipxitf_create(struct ipx_interface_definition *idef)
@@ -999,19 +996,19 @@
 	unsigned short dlink_type = 0;
 	struct datalink_proto *datalink = NULL;
 	struct ipx_interface *intrfc;
-	int err;
+	int rc;
 
 	if (idef->ipx_special == IPX_INTERNAL) {
-		err = ipxitf_create_internal(idef);
+		rc = ipxitf_create_internal(idef);
 		goto out;
 	}
 
-	err = -EEXIST;
+	rc = -EEXIST;
 	if (idef->ipx_special == IPX_PRIMARY && ipx_primary_net)
 		goto out;
 
 	intrfc = ipxitf_find_using_net(idef->ipx_network);
-	err = -EADDRINUSE;
+	rc = -EADDRINUSE;
 	if (idef->ipx_network && intrfc) {
 		ipxitf_put(intrfc);
 		goto out;
@@ -1021,49 +1018,49 @@
 		ipxitf_put(intrfc);
 
 	dev = dev_get_by_name(idef->ipx_device);
-	err = -ENODEV;
+	rc = -ENODEV;
 	if (!dev)
 		goto out;
 
 	switch (idef->ipx_dlink_type) {
-		case IPX_FRAME_TR_8022:
-			printk(KERN_WARNING "IPX frame type 802.2TR is "
-				"obsolete Use 802.2 instead.\n");
-			/* fall through */
-		case IPX_FRAME_8022:
-			dlink_type 	= htons(ETH_P_802_2);
-			datalink 	= p8022_datalink;
+	case IPX_FRAME_TR_8022:
+		printk(KERN_WARNING "IPX frame type 802.2TR is "
+			"obsolete Use 802.2 instead.\n");
+		/* fall through */
+	case IPX_FRAME_8022:
+		dlink_type 	= htons(ETH_P_802_2);
+		datalink 	= p8022_datalink;
+		break;
+	case IPX_FRAME_ETHERII:
+		if (dev->type != ARPHRD_IEEE802) {
+			dlink_type 	= htons(ETH_P_IPX);
+			datalink 	= pEII_datalink;
 			break;
-		case IPX_FRAME_ETHERII:
-			if (dev->type != ARPHRD_IEEE802) {
-				dlink_type 	= htons(ETH_P_IPX);
-				datalink 	= pEII_datalink;
-				break;
-			} else 
-				printk(KERN_WARNING "IPX frame type EtherII "
-					"over token-ring is obsolete. Use SNAP "
+		} else 
+			printk(KERN_WARNING "IPX frame type EtherII over "
+					"token-ring is obsolete. Use SNAP "
 					"instead.\n");
-			/* fall through */
-		case IPX_FRAME_SNAP:
-			dlink_type 	= htons(ETH_P_SNAP);
-			datalink 	= pSNAP_datalink;
-			break;
-		case IPX_FRAME_8023:
-			dlink_type 	= htons(ETH_P_802_3);
-			datalink 	= p8023_datalink;
-			break;
-		case IPX_FRAME_NONE:
-		default:
-			err = -EPROTONOSUPPORT;
-			goto out_dev;
+		/* fall through */
+	case IPX_FRAME_SNAP:
+		dlink_type 	= htons(ETH_P_SNAP);
+		datalink 	= pSNAP_datalink;
+		break;
+	case IPX_FRAME_8023:
+		dlink_type 	= htons(ETH_P_802_3);
+		datalink 	= p8023_datalink;
+		break;
+	case IPX_FRAME_NONE:
+	default:
+		rc = -EPROTONOSUPPORT;
+		goto out_dev;
 	}
 
-	err = -ENETDOWN;
+	rc = -ENETDOWN;
 	if (!(dev->flags & IFF_UP))
 		goto out_dev;
 
 	/* Check addresses are suitable */
-	err = -EINVAL;
+	rc = -EINVAL;
 	if (dev->addr_len > IPX_NODE_LEN)
 		goto out_dev;
 
@@ -1073,7 +1070,7 @@
 		intrfc = ipxitf_alloc(dev, idef->ipx_network, dlink_type,
 				      datalink, 0, dev->hard_header_len +
 					datalink->header_length);
-		err = -EAGAIN;
+		rc = -EAGAIN;
 		if (!intrfc)
 			goto out_dev;
 		/* Setup primary if necessary */
@@ -1092,18 +1089,18 @@
 
 
 	/* If the network number is known, add a route */
-	err = 0;
+	rc = 0;
 	if (!intrfc->if_netnum)
 		goto out_intrfc;
 
-	err = ipxitf_add_local_route(intrfc);
+	rc = ipxitf_add_local_route(intrfc);
 out_intrfc:
 	ipxitf_put(intrfc);
 	goto out;
 out_dev:
 	dev_put(dev);
 out:
-	return err;
+	return rc;
 }
 
 static int ipxitf_delete(struct ipx_interface_definition *idef)
@@ -1111,7 +1108,7 @@
 	struct net_device *dev = NULL;
 	unsigned short dlink_type = 0;
 	struct ipx_interface *intrfc;
-	int ret = 0;
+	int rc = 0;
 
 	spin_lock_bh(&ipx_interfaces_lock);
 	if (idef->ipx_special == IPX_INTERNAL) {
@@ -1119,30 +1116,30 @@
 			__ipxitf_put(ipx_internal_net);
 			goto out;
 		}
-		ret = -ENOENT;
+		rc = -ENOENT;
 		goto out;
 	}
 
 	dlink_type = ipx_map_frame_type(idef->ipx_dlink_type);
-	ret = -EPROTONOSUPPORT;
+	rc = -EPROTONOSUPPORT;
 	if (!dlink_type)
 		goto out;
 
 	dev = __dev_get_by_name(idef->ipx_device);
-	ret = -ENODEV;
+	rc = -ENODEV;
 	if (!dev)
 		goto out;
 
 	intrfc = __ipxitf_find_using_phys(dev, dlink_type);
-	ret = -EINVAL;
+	rc = -EINVAL;
 	if (!intrfc)
 		goto out;
 	__ipxitf_put(intrfc);
 
-	ret = 0;
+	rc = 0;
 out:
 	spin_unlock_bh(&ipx_interfaces_lock);
-	return ret;
+	return rc;
 }
 
 static struct ipx_interface *ipxitf_auto_create(struct net_device *dev,
@@ -1159,24 +1156,11 @@
 		goto out;
 
 	switch (htons(dlink_type)) {
-		case ETH_P_IPX:
-			datalink = pEII_datalink;
-			break;
-
-		case ETH_P_802_2:
-			datalink = p8022_datalink;
-			break;
-
-		case ETH_P_SNAP:
-			datalink = pSNAP_datalink;
-			break;
-
-		case ETH_P_802_3:
-			datalink = p8023_datalink;
-			break;
-
-		default:
-			goto out;
+	case ETH_P_IPX:		datalink = pEII_datalink;	break;
+	case ETH_P_802_2:	datalink = p8022_datalink;	break;
+	case ETH_P_SNAP:	datalink = pSNAP_datalink;	break;
+	case ETH_P_802_3:	datalink = p8023_datalink;	break;
+	default:		goto out;
 	}
 
 	intrfc = ipxitf_alloc(dev, 0, dlink_type, datalink, 0,
@@ -1198,80 +1182,82 @@
 
 static int ipxitf_ioctl(unsigned int cmd, void *arg)
 {
+	int rc = -EINVAL;
 	struct ifreq ifr;
 	int val;
 
 	switch (cmd) {
-		case SIOCSIFADDR: {
-			struct sockaddr_ipx *sipx;
-			struct ipx_interface_definition f;
-
-			if (copy_from_user(&ifr, arg, sizeof(ifr)))
-				return -EFAULT;
-
-			sipx = (struct sockaddr_ipx *)&ifr.ifr_addr;
-			if (sipx->sipx_family != AF_IPX)
-				return -EINVAL;
-
-			f.ipx_network = sipx->sipx_network;
-			memcpy(f.ipx_device, ifr.ifr_name,
-				sizeof(f.ipx_device));
-			memcpy(f.ipx_node, sipx->sipx_node, IPX_NODE_LEN);
-			f.ipx_dlink_type = sipx->sipx_type;
-			f.ipx_special = sipx->sipx_special;
-
-			if (sipx->sipx_action == IPX_DLTITF)
-				return ipxitf_delete(&f);
-			else
-				return ipxitf_create(&f);
-		}
+	case SIOCSIFADDR: {
+		struct sockaddr_ipx *sipx;
+		struct ipx_interface_definition f;
 
-		case SIOCGIFADDR: {
-			int err = 0;
-			struct sockaddr_ipx *sipx;
-			struct ipx_interface *ipxif;
-			struct net_device *dev;
-
-			if (copy_from_user(&ifr, arg, sizeof(ifr)))
-				return -EFAULT;
-
-			sipx = (struct sockaddr_ipx *)&ifr.ifr_addr;
-			dev = __dev_get_by_name(ifr.ifr_name);
-			if (!dev)
-				return -ENODEV;
-
-			ipxif = ipxitf_find_using_phys(dev, ipx_map_frame_type(sipx->sipx_type));
-			if (!ipxif)
-				return -EADDRNOTAVAIL;
-
-			sipx->sipx_family	= AF_IPX;
-			sipx->sipx_network	= ipxif->if_netnum;
-			memcpy(sipx->sipx_node, ipxif->if_node,
-				sizeof(sipx->sipx_node));
-			if (copy_to_user(arg, &ifr, sizeof(ifr)))
-				err = -EFAULT;
+		rc = -EFAULT;
+		if (copy_from_user(&ifr, arg, sizeof(ifr)))
+			break;
+		sipx = (struct sockaddr_ipx *)&ifr.ifr_addr;
+		rc = -EINVAL;
+		if (sipx->sipx_family != AF_IPX)
+			break;
+		f.ipx_network = sipx->sipx_network;
+		memcpy(f.ipx_device, ifr.ifr_name,
+			sizeof(f.ipx_device));
+		memcpy(f.ipx_node, sipx->sipx_node, IPX_NODE_LEN);
+		f.ipx_dlink_type = sipx->sipx_type;
+		f.ipx_special = sipx->sipx_special;
 
-			ipxitf_put(ipxif);
-			return err;
-		}
+		if (sipx->sipx_action == IPX_DLTITF)
+			rc = ipxitf_delete(&f);
+		else
+			rc = ipxitf_create(&f);
+		break;
+	}
+	case SIOCGIFADDR: {
+		struct sockaddr_ipx *sipx;
+		struct ipx_interface *ipxif;
+		struct net_device *dev;
 
-		case SIOCAIPXITFCRT: 
-			if (get_user(val, (unsigned char *) arg))
-				return -EFAULT;
-			ipxcfg_auto_create_interfaces = val;
+		rc = -EFAULT;
+		if (copy_from_user(&ifr, arg, sizeof(ifr)))
 			break;
-
-		case SIOCAIPXPRISLT: 
-			if (get_user(val, (unsigned char *) arg))
-				return -EFAULT;
-			ipxcfg_set_auto_select(val);
+		sipx = (struct sockaddr_ipx *)&ifr.ifr_addr;
+		dev  = __dev_get_by_name(ifr.ifr_name);
+		rc   = -ENODEV;
+		if (!dev)
+			break;
+		ipxif = ipxitf_find_using_phys(dev,
+					   ipx_map_frame_type(sipx->sipx_type));
+		rc = -EADDRNOTAVAIL;
+		if (!ipxif)
 			break;
 
-		default:
-			return -EINVAL;
+		sipx->sipx_family	= AF_IPX;
+		sipx->sipx_network	= ipxif->if_netnum;
+		memcpy(sipx->sipx_node, ipxif->if_node,
+			sizeof(sipx->sipx_node));
+		rc = -EFAULT;
+		if (copy_to_user(arg, &ifr, sizeof(ifr)))
+			break;
+		ipxitf_put(ipxif);
+		rc = 0;
+		break;
+	}
+	case SIOCAIPXITFCRT: 
+		rc = -EFAULT;
+		if (get_user(val, (unsigned char *) arg))
+			break;
+		rc = 0;
+		ipxcfg_auto_create_interfaces = val;
+		break;
+	case SIOCAIPXPRISLT: 
+		rc = -EFAULT;
+		if (get_user(val, (unsigned char *) arg))
+			break;
+		rc = 0;
+		ipxcfg_set_auto_select(val);
+		break;
 	}
 
-	return 0;
+	return rc;
 }
 
 /* Routing tables for the IPX socket layer. */
@@ -1307,13 +1293,13 @@
 			    unsigned char *node)
 {
 	struct ipx_route *rt;
-	int ret;
+	int rc;
 
 	/* Get a route structure; either existing or create */
 	rt = ipxrtr_lookup(network);
 	if (!rt) {
 		rt = kmalloc(sizeof(*rt), GFP_ATOMIC);
-		ret = -EAGAIN;
+		rc = -EAGAIN;
 		if (!rt)
 			goto out;
 
@@ -1324,7 +1310,7 @@
 		ipx_routes	= rt;
 		write_unlock_bh(&ipx_routes_lock);
 	} else {
-		ret = -EEXIST;
+		rc = -EEXIST;
 		if (intrfc == ipx_internal_net)
 			goto out_put;
 	}
@@ -1339,11 +1325,11 @@
 		rt->ir_routed = 1;
 	}
 
-	ret = 0;
+	rc = 0;
 out_put:
 	ipxrtr_put(rt);
 out:
-	return ret;
+	return rc;
 }
 
 static void ipxrtr_del_routes(struct ipx_interface *intrfc)
@@ -1364,44 +1350,44 @@
 static int ipxrtr_create(struct ipx_route_definition *rd)
 {
 	struct ipx_interface *intrfc;
-	int ret = -ENETUNREACH;
+	int rc = -ENETUNREACH;
 
 	/* Find the appropriate interface */
 	intrfc = ipxitf_find_using_net(rd->ipx_router_network);
 	if (!intrfc)
 		goto out;
-	ret = ipxrtr_add_route(rd->ipx_network, intrfc, rd->ipx_router_node);
+	rc = ipxrtr_add_route(rd->ipx_network, intrfc, rd->ipx_router_node);
 	ipxitf_put(intrfc);
 out:
-	return ret;
+	return rc;
 }
 
 static int ipxrtr_delete(long net)
 {
 	struct ipx_route **r;
 	struct ipx_route *tmp;
-	int err;
+	int rc;
 
 	write_lock_bh(&ipx_routes_lock);
 	for (r = &ipx_routes; (tmp = *r) != NULL;) {
 		if (tmp->ir_net == net) {
 			/* Directly connected; can't lose route */
-			err = -EPERM;
+			rc = -EPERM;
 			if (!tmp->ir_routed)
 				goto out;
 
 			*r = tmp->ir_next;
 			ipxrtr_put(tmp);
-			err = 0;
+			rc = 0;
 			goto out;
 		}
 
 		r = &(tmp->ir_next);
 	}
-	err = -ENOENT;
+	rc = -ENOENT;
 out:
 	write_unlock_bh(&ipx_routes_lock);
-	return err;
+	return rc;
 }
 
 /*
@@ -1456,7 +1442,7 @@
 	int size;
 	int ipx_offset;
 	struct ipx_route *rt = NULL;
-	int err;
+	int rc;
 
 	/* Find the appropriate interface on which to send packet */
 	if (!usipx->sipx_network && ipx_primary_net) {
@@ -1464,7 +1450,7 @@
 		intrfc = ipx_primary_net;
 	} else {
 		rt = ipxrtr_lookup(usipx->sipx_network);
-		err = -ENETUNREACH;
+		rc = -ENETUNREACH;
 		if (!rt)
 			goto out;
 		intrfc = rt->ir_intrfc;
@@ -1474,7 +1460,7 @@
 	ipx_offset = intrfc->if_ipx_offset;
 	size = sizeof(struct ipxhdr) + len + ipx_offset;
 
-	skb = sock_alloc_send_skb(sk, size, noblock, &err);
+	skb = sock_alloc_send_skb(sk, size, noblock, &rc);
 	if (!skb)
 		goto out_put;
 
@@ -1493,8 +1479,8 @@
 	IPX_SKB_CB(skb)->ipx_source_net = ipxs->intrfc->if_netnum;
 	memcpy(ipx->ipx_source.node, ipxs->node, IPX_NODE_LEN);
 #else
-	err = ntohs(ipxs->port);
-	if (err == 0x453 || err == 0x452) {
+	rc = ntohs(ipxs->port);
+	if (rc == 0x453 || rc == 0x452) {
 		/* RIP/SAP special handling for mars_nwe */
 		IPX_SKB_CB(skb)->ipx_source_net = intrfc->if_netnum;
 		memcpy(ipx->ipx_source.node, intrfc->if_node, IPX_NODE_LEN);
@@ -1509,8 +1495,8 @@
 	memcpy(ipx->ipx_dest.node, usipx->sipx_node, IPX_NODE_LEN);
 	ipx->ipx_dest.sock		= usipx->sipx_port;
 
-	err = memcpy_fromiovec(skb_put(skb, len), iov, len);
-	if (err) {
+	rc = memcpy_fromiovec(skb_put(skb, len), iov, len);
+	if (rc) {
 		kfree_skb(skb);
 		goto out_put;
 	}	
@@ -1521,14 +1507,14 @@
 	else
 		ipx->ipx_checksum = ipx_cksum(ipx, len + sizeof(struct ipxhdr));
 
-	err = ipxitf_send(intrfc, skb, (rt && rt->ir_routed) ? 
-				rt->ir_router_node : ipx->ipx_dest.node);
+	rc = ipxitf_send(intrfc, skb, (rt && rt->ir_routed) ? 
+			 rt->ir_router_node : ipx->ipx_dest.node);
 out_put:
 	ipxitf_put(intrfc);
 	if (rt)
 		ipxrtr_put(rt);
 out:
-	return err;
+	return rc;
 }
 
 /* the skb has to be unshared, we'll end up calling ipxitf_send, that'll
@@ -1559,7 +1545,7 @@
 {
 	struct rtentry rt;	/* Use these to behave like 'other' stacks */
 	struct sockaddr_ipx *sg, *st;
-	int ret = -EFAULT;
+	int rc = -EFAULT;
 
 	if (copy_from_user(&rt, arg, sizeof(rt)))
 		goto out;
@@ -1567,43 +1553,43 @@
 	sg = (struct sockaddr_ipx *)&rt.rt_gateway;
 	st = (struct sockaddr_ipx *)&rt.rt_dst;
 
-	ret = -EINVAL;
+	rc = -EINVAL;
 	if (!(rt.rt_flags & RTF_GATEWAY) || /* Direct routes are fixed */
 	    sg->sipx_family != AF_IPX ||
 	    st->sipx_family != AF_IPX)
 		goto out;
 
 	switch (cmd) {
-		case SIOCDELRT:
-			ret = ipxrtr_delete(st->sipx_network);
-			break;
-		case SIOCADDRT: {
-			struct ipx_route_definition f;
-			f.ipx_network		= st->sipx_network;
-			f.ipx_router_network	= sg->sipx_network;
-			memcpy(f.ipx_router_node, sg->sipx_node, IPX_NODE_LEN);
-			ret = ipxrtr_create(&f);
-			break;
-		}
+	case SIOCDELRT:
+		rc = ipxrtr_delete(st->sipx_network);
+		break;
+	case SIOCADDRT: {
+		struct ipx_route_definition f;
+		f.ipx_network		= st->sipx_network;
+		f.ipx_router_network	= sg->sipx_network;
+		memcpy(f.ipx_router_node, sg->sipx_node, IPX_NODE_LEN);
+		rc = ipxrtr_create(&f);
+		break;
+	}
 	}
 
 out:
-	return ret;
+	return rc;
 }
 
 const char *ipx_frame_name(unsigned short frame)
 {
-	char* ret = "None";
+	char* rc = "None";
 
 	switch (ntohs(frame)) {
-		case ETH_P_IPX:		ret = "EtherII";	break;
-		case ETH_P_802_2:	ret = "802.2";		break;
-		case ETH_P_SNAP:	ret = "SNAP";		break;
-		case ETH_P_802_3:	ret = "802.3";		break;
-		case ETH_P_TR_802_2:	ret = "802.2TR";	break;
+	case ETH_P_IPX:		rc = "EtherII";	break;
+	case ETH_P_802_2:	rc = "802.2";	break;
+	case ETH_P_SNAP:	rc = "SNAP";	break;
+	case ETH_P_802_3:	rc = "802.3";	break;
+	case ETH_P_TR_802_2:	rc = "802.2TR";	break;
 	}
 
-	return ret;
+	return rc;
 }
 
 const char *ipx_device_name(struct ipx_interface *intrfc)
@@ -1620,23 +1606,23 @@
 {
 	struct sock *sk = sock->sk;
 	int opt;
-	int ret = -EINVAL;
+	int rc = -EINVAL;
 
 	if (optlen != sizeof(int))
 		goto out;
 
-	ret = -EFAULT;
+	rc = -EFAULT;
 	if (get_user(opt, (unsigned int *)optval))
 		goto out;
 
-	ret = -ENOPROTOOPT;
+	rc = -ENOPROTOOPT;
 	if (!(level == SOL_IPX && optname == IPX_TYPE))
 		goto out;
 
 	ipx_sk(sk)->type = opt;
-	ret = 0;
+	rc = 0;
 out:
-	return ret;
+	return rc;
 }
 
 static int ipx_getsockopt(struct socket *sock, int level, int optname,
@@ -1645,60 +1631,59 @@
 	struct sock *sk = sock->sk;
 	int val = 0;
 	int len;
-	int ret = -ENOPROTOOPT;
+	int rc = -ENOPROTOOPT;
 
 	if (!(level == SOL_IPX && optname == IPX_TYPE))
 		goto out;
 
 	val = ipx_sk(sk)->type;
 
-	ret = -EFAULT;
+	rc = -EFAULT;
 	if (get_user(len, optlen))
 		goto out;
 
 	len = min_t(unsigned int, len, sizeof(int));
-	ret = -EINVAL;
+	rc = -EINVAL;
 	if(len < 0)
 		goto out;
 		
-	ret = -EFAULT;
+	rc = -EFAULT;
 	if (put_user(len, optlen) || copy_to_user(optval, &val, len))
 		goto out;
 
-	ret = 0;
+	rc = 0;
 out:
-	return ret;
+	return rc;
 }
 
 static int ipx_create(struct socket *sock, int protocol)
 {
-	int ret = -ESOCKTNOSUPPORT;
+	int rc = -ESOCKTNOSUPPORT;
 	struct ipx_opt *ipx = NULL;
 	struct sock *sk;
 
 	switch (sock->type) {
-		case SOCK_DGRAM:
-			sk = sk_alloc(PF_IPX, GFP_KERNEL, 1, NULL);
-                	ret = -ENOMEM;
-			if (!sk)
-				goto out;
-			ipx = ipx_sk(sk) = kmalloc(sizeof(*ipx), GFP_KERNEL);
-			if (!ipx)
-				goto outsk;
-			memset(ipx, 0, sizeof(*ipx));
-                        sock->ops = &ipx_dgram_ops;
-                        break;
-
-		case SOCK_SEQPACKET:
-			/*
-			 * SPX support is not anymore in the kernel sources. If
-			 * you want to ressurrect it, completing it and making
-			 * it understand shared skbs, be fully multithreaded,
-			 * etc, grab the sources in an early 2.5 kernel tree.
-			 */
-		case SOCK_STREAM:       /* Allow higher levels to piggyback */
-		default:
+	case SOCK_DGRAM:
+		sk = sk_alloc(PF_IPX, GFP_KERNEL, 1, NULL);
+        	rc = -ENOMEM;
+		if (!sk)
 			goto out;
+		ipx = ipx_sk(sk) = kmalloc(sizeof(*ipx), GFP_KERNEL);
+		if (!ipx)
+			goto outsk;
+		memset(ipx, 0, sizeof(*ipx));
+                sock->ops = &ipx_dgram_ops;
+                break;
+	case SOCK_SEQPACKET:
+		/*
+		 * SPX support is not anymore in the kernel sources. If
+		 * you want to ressurrect it, completing it and making
+		 * it understand shared skbs, be fully multithreaded,
+		 * etc, grab the sources in an early 2.5 kernel tree.
+		 */
+	case SOCK_STREAM:       /* Allow higher levels to piggyback */
+	default:
+		goto out;
 	}
 #ifdef IPX_REFCNT_DEBUG
         atomic_inc(&ipx_sock_nr);
@@ -1707,9 +1692,9 @@
 #endif
 	sock_init_data(sock, sk);
 	sk->no_check = 1;		/* Checksum off by default */
-	ret = 0;
+	rc = 0;
 out:
-	return ret;
+	return rc;
 outsk:
 	sk_free(sk);
 	goto out;
@@ -1761,25 +1746,25 @@
 	struct ipx_opt *ipxs = ipx_sk(sk);
 	struct ipx_interface *intrfc;
 	struct sockaddr_ipx *addr = (struct sockaddr_ipx *)uaddr;
-	int ret = -EINVAL;
+	int rc = -EINVAL;
 
 	if (!sk->zapped || addr_len != sizeof(struct sockaddr_ipx))
 		goto out;
 
 	intrfc = ipxitf_find_using_net(addr->sipx_network);
-	ret = -EADDRNOTAVAIL;
+	rc = -EADDRNOTAVAIL;
 	if (!intrfc)
 		goto out;
 
 	if (!addr->sipx_port) {
 		addr->sipx_port = ipx_first_free_socketnum(intrfc);
-		ret = -EINVAL;
+		rc = -EINVAL;
 		if (!addr->sipx_port)
 			goto out_put;
 	}
 
 	/* protect IPX system stuff like routing/sap */
-	ret = -EACCES;
+	rc = -EACCES;
 	if (ntohs(addr->sipx_port) < IPX_MIN_EPHEMERAL_SOCKET &&
 	    !capable(CAP_NET_ADMIN))
 		goto out_put;
@@ -1793,7 +1778,7 @@
 		 * node number 0 was specified, the default is used.
 		 */
 
-		ret = -EINVAL;
+		rc = -EINVAL;
 		if (!memcmp(addr->sipx_node, ipx_broadcast_node, IPX_NODE_LEN))
 			goto out_put;
 		if (!memcmp(addr->sipx_node, ipx_this_node, IPX_NODE_LEN))
@@ -1801,7 +1786,7 @@
 		else
 			memcpy(ipxs->node, addr->sipx_node, IPX_NODE_LEN);
 
-		ret = -EADDRINUSE;
+		rc = -EADDRINUSE;
 		if (ipxitf_find_internal_socket(intrfc, ipxs->node,
 						ipxs->port)) {
 			SOCK_DEBUG(sk,
@@ -1817,7 +1802,7 @@
 
 		memcpy(ipxs->node, intrfc->if_node, IPX_NODE_LEN);
 
-		ret = -EADDRINUSE;
+		rc = -EADDRINUSE;
 		if (ipxitf_find_socket(intrfc, addr->sipx_port)) {
 			SOCK_DEBUG(sk,
 				"IPX: bind failed because port %X in use.\n",
@@ -1831,7 +1816,7 @@
 	/* Source addresses are easy. It must be our network:node pair for
 	   an interface routed to IPX with the ipx routing ioctl() */
 
-	ret = -EADDRINUSE;
+	rc = -EADDRINUSE;
 	if (ipxitf_find_socket(intrfc, addr->sipx_port)) {
 		SOCK_DEBUG(sk, "IPX: bind failed because port %X in use.\n",
 				ntohs((int)addr->sipx_port));
@@ -1844,11 +1829,11 @@
 	sk->zapped = 0;
 	SOCK_DEBUG(sk, "IPX: bound socket 0x%04X.\n", ntohs(addr->sipx_port) );
 
-	ret = 0;
+	rc = 0;
 out_put:
 	ipxitf_put(intrfc);
 out:
-	return ret;
+	return rc;
 }
 
 static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
@@ -1857,7 +1842,7 @@
 	struct sock *sk = sock->sk;
 	struct ipx_opt *ipxs = ipx_sk(sk);
 	struct sockaddr_ipx *addr;
-	int ret = -EINVAL;
+	int rc = -EINVAL;
 	struct ipx_route *rt;
 
 	sk->state	= TCP_CLOSE;
@@ -1875,23 +1860,23 @@
 		uaddr.sipx_network 	= 0;
 
 #ifdef CONFIG_IPX_INTERN
-		ret = -ENETDOWN;
+		rc = -ENETDOWN;
 		if (!ipxs->intrfc)
 			goto out; /* Someone zonked the iface */
 		memcpy(uaddr.sipx_node, ipxs->intrfc->if_node,
 			IPX_NODE_LEN);
 #endif	/* CONFIG_IPX_INTERN */
 
-		ret = ipx_bind(sock, (struct sockaddr *)&uaddr,
-				sizeof(struct sockaddr_ipx));
-		if (ret)
+		rc = ipx_bind(sock, (struct sockaddr *)&uaddr,
+			      sizeof(struct sockaddr_ipx));
+		if (rc)
 			goto out;
 	}
 
         /* We can either connect to primary network or somewhere
 	 * we can route to */
 	rt = ipxrtr_lookup(addr->sipx_network);
-	ret = -ENETUNREACH;
+	rc = -ENETUNREACH;
 	if (!rt && !(!addr->sipx_network && ipx_primary_net))
 		goto out;
 
@@ -1907,9 +1892,9 @@
 
 	if (rt)
 		ipxrtr_put(rt);
-	ret = 0;
+	rc = 0;
 out:
-	return ret;
+	return rc;
 }
 
 
@@ -1920,12 +1905,12 @@
 	struct sockaddr_ipx sipx;
 	struct sock *sk = sock->sk;
 	struct ipx_opt *ipxs = ipx_sk(sk);
-	int ret;
+	int rc;
 
 	*uaddr_len = sizeof(struct sockaddr_ipx);
 
 	if (peer) {
-		ret = -ENOTCONN;
+		rc = -ENOTCONN;
 		if (sk->state != TCP_ESTABLISHED)
 			goto out;
 
@@ -1955,9 +1940,9 @@
 	sipx.sipx_type	 = ipxs->type;
 	memcpy(uaddr, &sipx, sizeof(sipx));
 
-	ret = 0;
+	rc = 0;
 out:
-	return ret;
+	return rc;
 }
 
 int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
@@ -1966,7 +1951,7 @@
 	struct ipx_interface *intrfc;
 	struct ipxhdr *ipx;
 	u16 ipx_pktsize;
-	int ret = 0;
+	int rc = 0;
 		
 	/* Not ours */	
         if (skb->pkt_type == PACKET_OTHERHOST)
@@ -2005,13 +1990,13 @@
 			goto drop;
 	}
 
-	ret = ipxitf_rcv(intrfc, skb);
+	rc = ipxitf_rcv(intrfc, skb);
 	ipxitf_put(intrfc);
 	goto out;
 drop:
 	kfree_skb(skb);
 out:
-	return ret;
+	return rc;
 }
 
 static int ipx_sendmsg(struct kiocb *iocb, struct socket *sock,
@@ -2021,7 +2006,7 @@
 	struct ipx_opt *ipxs = ipx_sk(sk);
 	struct sockaddr_ipx *usipx = (struct sockaddr_ipx *)msg->msg_name;
 	struct sockaddr_ipx local_sipx;
-	int ret = -EINVAL;
+	int rc = -EINVAL;
 	int flags = msg->msg_flags;
 
 	/* Socket gets bound below anyway */
@@ -2037,24 +2022,24 @@
 			uaddr.sipx_port		= 0;
 			uaddr.sipx_network	= 0;
 #ifdef CONFIG_IPX_INTERN
-			ret = -ENETDOWN;
+			rc = -ENETDOWN;
 			if (!ipxs->intrfc)
 				goto out; /* Someone zonked the iface */
 			memcpy(uaddr.sipx_node, ipxs->intrfc->if_node,
 				IPX_NODE_LEN);
 #endif
-			ret = ipx_bind(sock, (struct sockaddr *)&uaddr,
+			rc = ipx_bind(sock, (struct sockaddr *)&uaddr,
 					sizeof(struct sockaddr_ipx));
-			if (ret)
+			if (rc)
 				goto out;
 		}
 
-		ret = -EINVAL;
+		rc = -EINVAL;
 		if (msg->msg_namelen < sizeof(*usipx) ||
 		    usipx->sipx_family != AF_IPX)
 			goto out;
 	} else {
-		ret = -ENOTCONN;
+		rc = -ENOTCONN;
 		if (sk->state != TCP_ESTABLISHED)
 			goto out;
 
@@ -2066,12 +2051,12 @@
 		memcpy(usipx->sipx_node, ipxs->dest_addr.node, IPX_NODE_LEN);
 	}
 
-	ret = ipxrtr_route_packet(sk, usipx, msg->msg_iov, len,
-				     flags & MSG_DONTWAIT);
-	if (ret >= 0)
-		ret = len;
+	rc = ipxrtr_route_packet(sk, usipx, msg->msg_iov, len,
+				 flags & MSG_DONTWAIT);
+	if (rc >= 0)
+		rc = len;
 out:
-	return ret;
+	return rc;
 }
 
 
@@ -2083,7 +2068,7 @@
 	struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)msg->msg_name;
 	struct ipxhdr *ipx = NULL;
 	struct sk_buff *skb;
-	int copied, err;
+	int copied, rc;
 
 	/* put the autobinding in */
 	if (!ipxs->port) {
@@ -2093,24 +2078,24 @@
 		uaddr.sipx_network 	= 0;
 
 #ifdef CONFIG_IPX_INTERN
-		err = -ENETDOWN;
+		rc = -ENETDOWN;
 		if (!ipxs->intrfc)
 			goto out; /* Someone zonked the iface */
 		memcpy(uaddr.sipx_node, ipxs->intrfc->if_node, IPX_NODE_LEN);
 #endif	/* CONFIG_IPX_INTERN */
 
-		err = ipx_bind(sock, (struct sockaddr *)&uaddr,
-				sizeof(struct sockaddr_ipx));
-		if (err)
+		rc = ipx_bind(sock, (struct sockaddr *)&uaddr,
+			      sizeof(struct sockaddr_ipx));
+		if (rc)
 			goto out;
 	}
 	
-	err = -ENOTCONN;
+	rc = -ENOTCONN;
 	if (sk->zapped)
 		goto out;
 
 	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-					flags & MSG_DONTWAIT, &err);
+				flags & MSG_DONTWAIT, &rc);
 	if (!skb)
 		goto out;
 
@@ -2121,9 +2106,9 @@
 		msg->msg_flags |= MSG_TRUNC;
 	}
 
-	err = skb_copy_datagram_iovec(skb, sizeof(struct ipxhdr), msg->msg_iov,
-					copied);
-	if (err)
+	rc = skb_copy_datagram_iovec(skb, sizeof(struct ipxhdr), msg->msg_iov,
+				     copied);
+	if (rc)
 		goto out_free;
 	sk->stamp = skb->stamp;
 
@@ -2136,92 +2121,92 @@
 		sipx->sipx_network	= IPX_SKB_CB(skb)->ipx_source_net;
 		sipx->sipx_type 	= ipx->ipx_type;
 	}
-	err = copied;
+	rc = copied;
 
 out_free:
 	skb_free_datagram(sk, skb);
 out:
-	return err;
+	return rc;
 }
 
 
 static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
+	int rc = 0;
 	long amount = 0;
 	struct sock *sk = sock->sk;
 
 	switch (cmd) {
-		case TIOCOUTQ:
-			amount = sk->sndbuf - atomic_read(&sk->wmem_alloc);
-			if (amount < 0)
-				amount = 0;
-			return put_user(amount, (int *)arg);
-
-		case TIOCINQ: {
-			struct sk_buff *skb = skb_peek(&sk->receive_queue);
-			/* These two are safe on a single CPU system as only
-			 * user tasks fiddle here */
-			if (skb)
-				amount = skb->len - sizeof(struct ipxhdr);
-			return put_user(amount, (int *)arg);
-		}
-
-		case SIOCADDRT:
-		case SIOCDELRT:
-			if (!capable(CAP_NET_ADMIN))
-				return -EPERM;
-			return ipxrtr_ioctl(cmd, (void *)arg);
-
-		case SIOCSIFADDR:
-		case SIOCAIPXITFCRT:
-		case SIOCAIPXPRISLT:
-			if (!capable(CAP_NET_ADMIN))
-				return -EPERM;
-
-		case SIOCGIFADDR:
-			return ipxitf_ioctl(cmd, (void *)arg);
-
-		case SIOCIPXCFGDATA:
-			return ipxcfg_get_config_data((void *)arg);
-
-		case SIOCIPXNCPCONN:
-			/*
-			 * This socket wants to take care of the NCP connection
-			 * handed to us in arg.
-			 */
-                	if (!capable(CAP_NET_ADMIN))
-                		return -EPERM;
-			return get_user(ipx_sk(sk)->ipx_ncp_conn,
-					(const unsigned short *)(arg));
-
-		case SIOCGSTAMP: {
-			int ret = -EINVAL;
-			if (sk) {
-				if (!sk->stamp.tv_sec)
-					return -ENOENT;
-				ret = -EFAULT;
-				if (!copy_to_user((void *)arg, &sk->stamp,
-						sizeof(struct timeval)))
-					ret = 0;
-			}
-
-			return ret;
+	case TIOCOUTQ:
+		amount = sk->sndbuf - atomic_read(&sk->wmem_alloc);
+		if (amount < 0)
+			amount = 0;
+		rc = put_user(amount, (int *)arg);
+		break;
+	case TIOCINQ: {
+		struct sk_buff *skb = skb_peek(&sk->receive_queue);
+		/* These two are safe on a single CPU system as only
+		 * user tasks fiddle here */
+		if (skb)
+			amount = skb->len - sizeof(struct ipxhdr);
+		rc = put_user(amount, (int *)arg);
+		break;
+	}
+	case SIOCADDRT:
+	case SIOCDELRT:
+		rc = -EPERM;
+		if (capable(CAP_NET_ADMIN))
+			rc = ipxrtr_ioctl(cmd, (void *)arg);
+		break;
+	case SIOCSIFADDR:
+	case SIOCAIPXITFCRT:
+	case SIOCAIPXPRISLT:
+		rc = -EPERM;
+		if (!capable(CAP_NET_ADMIN))
+			break;
+	case SIOCGIFADDR:
+		rc = ipxitf_ioctl(cmd, (void *)arg);
+		break;
+	case SIOCIPXCFGDATA:
+		rc = ipxcfg_get_config_data((void *)arg);
+		break;
+	case SIOCIPXNCPCONN:
+		/*
+		 * This socket wants to take care of the NCP connection
+		 * handed to us in arg.
+		 */
+        	rc = -EPERM;
+        	if (!capable(CAP_NET_ADMIN))
+			break;
+		rc = get_user(ipx_sk(sk)->ipx_ncp_conn,
+			      (const unsigned short *)(arg));
+		break;
+	case SIOCGSTAMP:
+		rc = -EINVAL;
+		if (sk) {
+			rc = -ENOENT;
+			if (!sk->stamp.tv_sec)
+				break;
+			rc = -EFAULT;
+			if (!copy_to_user((void *)arg, &sk->stamp,
+					  sizeof(struct timeval)))
+				rc = 0;
 		}
-
-		case SIOCGIFDSTADDR:
-		case SIOCSIFDSTADDR:
-		case SIOCGIFBRDADDR:
-		case SIOCSIFBRDADDR:
-		case SIOCGIFNETMASK:
-		case SIOCSIFNETMASK:
-			return -EINVAL;
-
-		default:
-			return dev_ioctl(cmd,(void *) arg);
+		break;
+	case SIOCGIFDSTADDR:
+	case SIOCSIFDSTADDR:
+	case SIOCGIFBRDADDR:
+	case SIOCSIFBRDADDR:
+	case SIOCGIFNETMASK:
+	case SIOCSIFNETMASK:
+		rc = -EINVAL;
+		break;
+	default:
+		rc = dev_ioctl(cmd,(void *) arg);
+		break;
 	}
 
-	/*NOT REACHED*/
-	return 0;
+	return rc;
 }
 
 /*
@@ -2258,19 +2243,19 @@
 SOCKOPS_WRAP(ipx_dgram, PF_IPX);
 
 static struct packet_type ipx_8023_packet_type = {
-	.type =		__constant_htons(ETH_P_802_3),
-	.func =		ipx_rcv,
-	.data =		(void *) 1,	/* yap, I understand shared skbs :-) */
+	.type		= __constant_htons(ETH_P_802_3),
+	.func		= ipx_rcv,
+	.data		= (void *)1,	/* yap, I understand shared skbs :-) */
 };
 
 static struct packet_type ipx_dix_packet_type = {
-	.type =		__constant_htons(ETH_P_IPX),
-	.func =		ipx_rcv,
-	.data =		(void *) 1,	/* yap, I understand shared skbs :-) */
+	.type		= __constant_htons(ETH_P_IPX),
+	.func		= ipx_rcv,
+	.data		= (void *)1,	/* yap, I understand shared skbs :-) */
 };
 
 static struct notifier_block ipx_dev_notifier = {
-	.notifier_call =ipxitf_device_event,
+	.notifier_call	= ipxitf_device_event,
 };
 
 extern struct datalink_proto *make_EII_client(void);
@@ -2324,21 +2309,6 @@
 	return 0;
 }
 
-module_init(ipx_init);
-
-/* Note on MOD_{INC,DEC}_USE_COUNT:
- *
- * Use counts are incremented/decremented when
- * sockets are created/deleted.
- *
- * Routes are always associated with an interface, and
- * allocs/frees will remain properly accounted for by
- * their associated interfaces.
- *
- * Ergo, before the ipx module can be removed, all IPX
- * sockets be closed from user space.
- */
-
 static void __exit ipx_proto_finito(void)
 {
 	/*
@@ -2369,5 +2339,6 @@
 	sock_unregister(ipx_family_ops.family);
 }
 
+module_init(ipx_init);
 module_exit(ipx_proto_finito);
 MODULE_LICENSE("GPL");
diff -urN linux-2.5.68-bk9/net/irda/af_irda.c linux-2.5.68-bk10/net/irda/af_irda.c
--- linux-2.5.68-bk9/net/irda/af_irda.c	2003-04-19 19:48:57.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/af_irda.c	2003-04-30 04:34:58.000000000 -0700
@@ -858,7 +858,7 @@
 	 */
 
 	/*
-	 * We can perform the accept only if there is incomming data
+	 * We can perform the accept only if there is incoming data
 	 * on the listening socket.
 	 * So, we will block the caller until we receive any data.
 	 * If the caller was waiting on select() or poll() before
@@ -1132,9 +1132,6 @@
 	self->nslots = DISCOVERY_DEFAULT_SLOTS;
 	self->daddr = DEV_ADDR_ANY;	/* Until we get connected */
 	self->saddr = 0x0;		/* so IrLMP assign us any link */
-
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -1177,9 +1174,6 @@
 	}
 #endif /* CONFIG_IRDA_ULTRA */
 	kfree(self);
-	MOD_DEC_USE_COUNT;
-
-	return;
 }
 
 /*
@@ -1216,7 +1210,7 @@
 	/* Notes on socket locking and deallocation... - Jean II
 	 * In theory we should put pairs of sock_hold() / sock_put() to
 	 * prevent the socket to be destroyed whenever there is an
-	 * outstanding request or outstanding incomming packet or event.
+	 * outstanding request or outstanding incoming packet or event.
 	 *
 	 * 1) This may include IAS request, both in connect and getsockopt.
 	 * Unfortunately, the situation is a bit more messy than it looks,
@@ -2409,6 +2403,7 @@
 static struct net_proto_family irda_family_ops = {
 	.family = PF_IRDA,
 	.create = irda_create,
+	.owner	= THIS_MODULE,
 };
 
 static struct proto_ops SOCKOPS_WRAPPED(irda_stream_ops) = {
diff -urN linux-2.5.68-bk9/net/irda/ircomm/ircomm_param.c linux-2.5.68-bk10/net/irda/ircomm/ircomm_param.c
--- linux-2.5.68-bk9/net/irda/ircomm/ircomm_param.c	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/ircomm/ircomm_param.c	2003-04-30 04:34:58.000000000 -0700
@@ -176,7 +176,7 @@
  * Function ircomm_param_service_type (self, buf, len)
  *
  *    Handle service type, this function will both be called after the LM-IAS
- *    query and then the remote device sends its initial paramters
+ *    query and then the remote device sends its initial parameters
  *
  */
 static int ircomm_param_service_type(void *instance, irda_param_t *param, 
diff -urN linux-2.5.68-bk9/net/irda/ircomm/ircomm_tty_attach.c linux-2.5.68-bk10/net/irda/ircomm/ircomm_tty_attach.c
--- linux-2.5.68-bk9/net/irda/ircomm/ircomm_tty_attach.c	2003-04-19 19:50:48.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/ircomm/ircomm_tty_attach.c	2003-04-30 04:34:58.000000000 -0700
@@ -518,12 +518,12 @@
 	del_timer(&self->watchdog_timer);
 
 	/* Remove LM-IAS object now so it is not reused.
-	 * IrCOMM deals very poorly with multiple incomming connections.
+	 * IrCOMM deals very poorly with multiple incoming connections.
 	 * It should looks a lot more like IrNET, and "dup" a server TSAP
 	 * to the application TSAP (based on various rules).
 	 * This is a cheap workaround allowing multiple clients to
 	 * connect to us. It will not always work.
-	 * Each IrCOMM socket has an IAS entry. Incomming connection will
+	 * Each IrCOMM socket has an IAS entry. Incoming connection will
 	 * pick the first one found. So, when we are fully connected,
 	 * we remove our IAS entries so that the next IAS entry is used.
 	 * We do that for *both* client and server, because a server
diff -urN linux-2.5.68-bk9/net/irda/irda_device.c linux-2.5.68-bk10/net/irda/irda_device.c
--- linux-2.5.68-bk9/net/irda/irda_device.c	2003-04-19 19:49:26.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irda_device.c	2003-04-30 04:34:58.000000000 -0700
@@ -120,7 +120,7 @@
 /*
  * Function irda_device_set_media_busy (self, status)
  *
- *    Called when we have detected that another station is transmiting
+ *    Called when we have detected that another station is transmitting
  *    in contention mode.
  */
 void irda_device_set_media_busy(struct net_device *dev, int status)
@@ -480,7 +480,7 @@
  */
 int irda_device_register_dongle(struct dongle_reg *new)
 {
-	/* Check if this dongle has been registred before */
+	/* Check if this dongle has been registered before */
 	if (hashbin_lock_find(dongles, new->type, NULL)) {
 		MESSAGE("%s: Dongle already registered\n", __FUNCTION__);
                 return 0;
@@ -495,7 +495,7 @@
 /*
  * Function irda_device_unregister_dongle (dongle)
  *
- *    Unregister dongle, and remove dongle from list of registred dongles
+ *    Unregister dongle, and remove dongle from list of registered dongles
  *
  */
 void irda_device_unregister_dongle(struct dongle_reg *dongle)
diff -urN linux-2.5.68-bk9/net/irda/iriap.c linux-2.5.68-bk10/net/irda/iriap.c
--- linux-2.5.68-bk9/net/irda/iriap.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/iriap.c	2003-04-30 04:34:58.000000000 -0700
@@ -273,7 +273,7 @@
 /*
  * Function iriap_disconnect_indication (handle, reason)
  *
- *    Got disconnect, so clean up everything assosiated with this connection
+ *    Got disconnect, so clean up everything associated with this connection
  *
  */
 static void iriap_disconnect_indication(void *instance, void *sap,
diff -urN linux-2.5.68-bk9/net/irda/irias_object.c linux-2.5.68-bk10/net/irda/irias_object.c
--- linux-2.5.68-bk9/net/irda/irias_object.c	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irias_object.c	2003-04-30 04:34:58.000000000 -0700
@@ -140,7 +140,7 @@
 /*
  * Function irias_delete_object (obj)
  *
- *    Remove object from hashbin and deallocate all attributes assosiated with
+ *    Remove object from hashbin and deallocate all attributes associated with
  *    with this object and the object itself
  *
  */
diff -urN linux-2.5.68-bk9/net/irda/irlan/irlan_common.c linux-2.5.68-bk10/net/irda/irlan/irlan_common.c
--- linux-2.5.68-bk9/net/irda/irlan/irlan_common.c	2003-04-19 19:49:52.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irlan/irlan_common.c	2003-04-30 04:34:58.000000000 -0700
@@ -524,7 +524,7 @@
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
 	
 	/* 
-	 * Check if object has already been registred by a previous provider.
+	 * Check if object has already been registered by a previous provider.
 	 * If that is the case, we just change the value of the attribute
 	 */
 	if (!irias_find_object("IrLAN")) {
@@ -538,7 +538,7 @@
 					      new_value);
 	}
 	
-        /* Register PnP object only if not registred before */
+        /* Register PnP object only if not registered before */
         if (!irias_find_object("PnP")) {
 		obj = irias_new_object("PnP", IAS_PNP_ID);
 #if 0
@@ -835,7 +835,7 @@
 /*
  * Function irlan_get_unicast_addr (self)
  *
- *    Retrives the unicast address from the IrLAN provider. This address
+ *    Retrieves the unicast address from the IrLAN provider. This address
  *    will be inserted into the devices structure, so the ethernet layer
  *    can construct its packets.
  *
diff -urN linux-2.5.68-bk9/net/irda/irlap.c linux-2.5.68-bk10/net/irda/irlap.c
--- linux-2.5.68-bk9/net/irda/irlap.c	2003-04-19 19:51:08.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irlap.c	2003-04-30 04:34:58.000000000 -0700
@@ -997,12 +997,12 @@
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == LAP_MAGIC, return;);
 
-	/* Set the negociated xbofs value */
+	/* Set the negotiated xbofs value */
 	self->next_bofs   = self->qos_tx.additional_bofs.value;
 	if (now)
 		self->bofs_count = self->next_bofs;
 
-	/* Set the negociated link speed (may need the new xbofs value) */
+	/* Set the negotiated link speed (may need the new xbofs value) */
 	irlap_change_speed(self, self->qos_tx.baud_rate.value, now);
 
 	self->window_size = self->qos_tx.window_size.value;
diff -urN linux-2.5.68-bk9/net/irda/irlap_event.c linux-2.5.68-bk10/net/irda/irlap_event.c
--- linux-2.5.68-bk9/net/irda/irlap_event.c	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irlap_event.c	2003-04-30 04:34:58.000000000 -0700
@@ -771,7 +771,7 @@
 		/* This is full of good intentions, but doesn't work in
 		 * practice.
 		 * After sending the first UA response, we switch the
-		 * dongle to the negociated speed, which is usually
+		 * dongle to the negotiated speed, which is usually
 		 * different than 9600 kb/s.
 		 * From there, there is two solutions :
 		 * 1) The other end has received the first UA response :
@@ -779,7 +779,7 @@
 		 * and will ignore and drop the second UA response.
 		 * Actually, it's even worse : the other side will almost
 		 * immediately send a RR that will likely collide with the
-		 * UA response (depending on negociated turnaround).
+		 * UA response (depending on negotiated turnaround).
 		 * 2) The other end has not received the first UA response,
 		 * will stay at 9600 and will never see the second UA response.
 		 * Jean II */
diff -urN linux-2.5.68-bk9/net/irda/irlmp.c linux-2.5.68-bk10/net/irda/irlmp.c
--- linux-2.5.68-bk9/net/irda/irlmp.c	2003-04-19 19:50:49.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irlmp.c	2003-04-30 04:34:58.000000000 -0700
@@ -975,7 +975,7 @@
 /*
  * Function irlmp_discovery_expiry (expiry)
  *
- *	This device is no longer been discovered, and therefore it is beeing
+ *	This device is no longer been discovered, and therefore it is being
  *	purged from the discovery log. Inform all clients who have
  *	registered for this event...
  *
@@ -1279,7 +1279,7 @@
  * Function irlmp_hint_to_service (hint)
  *
  *    Returns a list of all servics contained in the given hint bits. This
- *    funtion assumes that the hint bits have the size of two bytes only
+ *    function assumes that the hint bits have the size of two bytes only
  */
 __u8 *irlmp_hint_to_service(__u8 *hint)
 {
@@ -1576,7 +1576,7 @@
 
 	/*
 	 *  Check if slsap is already in use. To do this we have to loop over
-	 *  every IrLAP connection and check every LSAP assosiated with each
+	 *  every IrLAP connection and check every LSAP associated with each
 	 *  the connection.
 	 */
 	spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
diff -urN linux-2.5.68-bk9/net/irda/irlmp_event.c linux-2.5.68-bk10/net/irda/irlmp_event.c
--- linux-2.5.68-bk9/net/irda/irlmp_event.c	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irlmp_event.c	2003-04-30 04:34:58.000000000 -0700
@@ -395,7 +395,7 @@
 		IRDA_DEBUG(4, "%s(), LS_CONNECT_REQUEST\n", __FUNCTION__);
 
 		/*
-		 *  LAP connection allready active, just bounce back! Since we
+		 *  LAP connection already active, just bounce back! Since we
 		 *  don't know which LSAP that tried to do this, we have to
 		 *  notify all LSAPs using this LAP, but that should be safe to
 		 *  do anyway.
diff -urN linux-2.5.68-bk9/net/irda/irlmp_frame.c linux-2.5.68-bk10/net/irda/irlmp_frame.c
--- linux-2.5.68-bk9/net/irda/irlmp_frame.c	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irlmp_frame.c	2003-04-30 04:34:58.000000000 -0700
@@ -418,7 +418,7 @@
 static inline void irlmp_update_cache(struct lap_cb *lap,
 				      struct lsap_cb *lsap)
 {
-	/* Prevent concurent read to get garbage */
+	/* Prevent concurrent read to get garbage */
 	lap->cache.valid = FALSE;
 	/* Update cache entry */
 	lap->cache.dlsap_sel = lsap->dlsap_sel;
@@ -431,7 +431,7 @@
 /*
  * Function irlmp_find_handle (self, dlsap_sel, slsap_sel, status, queue)
  *
- *    Find handle assosiated with destination and source LSAP
+ *    Find handle associated with destination and source LSAP
  *
  * Any IrDA connection (LSAP/TSAP) is uniquely identified by
  * 3 parameters, the local lsap, the remote lsap and the remote address. 
@@ -479,7 +479,7 @@
 		if ((status == CONNECT_CMD) && 
 		    (lsap->slsap_sel == slsap_sel) &&      
 		    (lsap->dlsap_sel == LSAP_ANY)) {
-			/* This is where the dest lsap sel is set on incomming
+			/* This is where the dest lsap sel is set on incoming
 			 * lsaps */
 			lsap->dlsap_sel = dlsap_sel;
 			break;
diff -urN linux-2.5.68-bk9/net/irda/irnet/irnet.h linux-2.5.68-bk10/net/irda/irnet/irnet.h
--- linux-2.5.68-bk9/net/irda/irnet/irnet.h	2003-04-19 19:50:08.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irnet/irnet.h	2003-04-30 04:34:58.000000000 -0700
@@ -115,9 +115,9 @@
  * socket is then connected in the originating node to the pppd instance.
  * At this point, in the originating node, the first socket is closed.
  *
- * I admit, this is a bit messy and waste some ressources. The alternative
+ * I admit, this is a bit messy and waste some resources. The alternative
  * is caching incoming socket, and that's also quite messy and waste
- * ressources.
+ * resources.
  * We also make connection time slower. For example, on a 115 kb/s link it
  * adds 60ms to the connection time (770 ms). However, this is slower than
  * the time it takes to fire up pppd on my P133...
diff -urN linux-2.5.68-bk9/net/irda/irnet/irnet_irda.c linux-2.5.68-bk10/net/irda/irnet/irnet_irda.c
--- linux-2.5.68-bk9/net/irda/irnet/irnet_irda.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irnet/irnet_irda.c	2003-04-30 04:34:58.000000000 -0700
@@ -13,7 +13,7 @@
 /************************* CONTROL CHANNEL *************************/
 /*
  * When ppp is not active, /dev/irnet act as a control channel.
- * Writting allow to set up the IrDA destination of the IrNET channel,
+ * Writing allow to set up the IrDA destination of the IrNET channel,
  * and any application may be read events happening on IrNET...
  */
 
@@ -859,7 +859,7 @@
   /* As currently we don't block packets in ppp_irnet_send() while passive,
    * this is not really needed...
    * Also, not doing it give IrDA a chance to finish the setup properly
-   * before beeing swamped with packets... */
+   * before being swamped with packets... */
   ppp_output_wakeup(&new->chan);
 #endif /* CONNECT_INDIC_KICK */
 
diff -urN linux-2.5.68-bk9/net/irda/irnet/irnet_ppp.c linux-2.5.68-bk10/net/irda/irnet/irnet_ppp.c
--- linux-2.5.68-bk9/net/irda/irnet/irnet_ppp.c	2003-04-19 19:50:33.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irnet/irnet_ppp.c	2003-04-30 04:34:58.000000000 -0700
@@ -20,7 +20,7 @@
 /*
  * When a pppd instance is not active on /dev/irnet, it acts as a control
  * channel.
- * Writting allow to set up the IrDA destination of the IrNET channel,
+ * Writing allow to set up the IrDA destination of the IrNET channel,
  * and any application may be read events happening in IrNET...
  */
 
@@ -39,7 +39,7 @@
 		 size_t		count)
 {
   char		command[IRNET_MAX_COMMAND];
-  char *	start;		/* Current command beeing processed */
+  char *	start;		/* Current command being processed */
   char *	next;		/* Next command to process */
   int		length;		/* Length of current command */
 
diff -urN linux-2.5.68-bk9/net/irda/irqueue.c linux-2.5.68-bk10/net/irda/irqueue.c
--- linux-2.5.68-bk9/net/irda/irqueue.c	2003-04-19 19:48:52.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irqueue.c	2003-04-30 04:34:58.000000000 -0700
@@ -50,13 +50,13 @@
  */
 
 /*
- * Notes on the concurent access to hashbin and other SMP issues
+ * Notes on the concurrent access to hashbin and other SMP issues
  * -------------------------------------------------------------
  *	Hashbins are very often in the IrDA stack a global repository of
  * information, and therefore used in a very asynchronous manner following
  * various events (driver calls, timers, user calls...).
  *	Therefore, very often it is highly important to consider the
- * management of concurent access to the hashbin and how to guarantee the
+ * management of concurrent access to the hashbin and how to guarantee the
  * consistency of the operations on it.
  *
  *	First, we need to define the objective of locking :
@@ -158,12 +158,12 @@
  * Locking Policy :
  * --------------
  *	If the hashbin is used only in a single thread of execution
- * (explicitely or implicitely), you can use HB_NOLOCK
- *	If the calling module already provide concurent access protection,
+ * (explicitly or implicitely), you can use HB_NOLOCK
+ *	If the calling module already provide concurrent access protection,
  * you may use HB_NOLOCK.
  *
  *	In all other cases, you need to use HB_LOCK and lock the hashbin
- * everytime before calling one of the unprotected calls. You also must
+ * every time before calling one of the unprotected calls. You also must
  * use the pointer returned by the unprotected call within the locked
  * region.
  *
@@ -912,7 +912,7 @@
  *
  *    Find an item with the given hashv or name, and its successor
  *
- * This function allow to do concurent enumerations without the
+ * This function allow to do concurrent enumerations without the
  * need to lock over the whole session, because the caller keep the
  * context of the search. On the other hand, it might fail and return
  * NULL if the entry is removed. - Jean II
@@ -987,7 +987,7 @@
  *    NULL when all items have been traversed
  * 
  * The context of the search is stored within the hashbin, so you must
- * protect yourself from concurent enumerations. - Jean II
+ * protect yourself from concurrent enumerations. - Jean II
  */
 irda_queue_t *hashbin_get_next( hashbin_t *hashbin)
 {
diff -urN linux-2.5.68-bk9/net/irda/irttp.c linux-2.5.68-bk10/net/irda/irttp.c
--- linux-2.5.68-bk9/net/irda/irttp.c	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/irttp.c	2003-04-30 04:34:58.000000000 -0700
@@ -478,7 +478,7 @@
  *    Remove TSAP from list of all TSAPs and then deallocate all resources
  *    associated with this TSAP
  *
- * Note : because we *free* the tsap structure, it is the responsability
+ * Note : because we *free* the tsap structure, it is the responsibility
  * of the caller to make sure we are called only once and to deal with
  * possible race conditions. - Jean II
  */
@@ -999,7 +999,7 @@
 /*
  * Function irttp_flow_request (self, command)
  *
- *    This funtion could be used by the upper layers to tell IrTTP to stop
+ *    This function could be used by the upper layers to tell IrTTP to stop
  *    delivering frames if the receive queues are starting to get full, or
  *    to tell IrTTP to start delivering frames again.
  */
diff -urN linux-2.5.68-bk9/net/irda/qos.c linux-2.5.68-bk10/net/irda/qos.c
--- linux-2.5.68-bk9/net/irda/qos.c	2003-04-19 19:50:44.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/qos.c	2003-04-30 04:34:58.000000000 -0700
@@ -72,7 +72,7 @@
  * payload), that's only 2042 bytes. Oups !
  * My nsc-ircc hardware has troubles receiving 2048 bytes frames at 4 Mb/s,
  * so adjust to 2042... I don't know if this bug applies only for 2048
- * bytes frames or all negociated frame sizes, but you can use the sysctl
+ * bytes frames or all negotiated frame sizes, but you can use the sysctl
  * to play with this value anyway.
  * Jean II */
 unsigned sysctl_max_tx_data_size = 2042;
@@ -280,7 +280,7 @@
 /*
  * Function irda_qos_compute_intersection (qos, new)
  *
- *    Compute the intersection of the old QoS capabilites with new ones
+ *    Compute the intersection of the old QoS capabilities with new ones
  *
  */
 void irda_qos_compute_intersection(struct qos_info *qos, struct qos_info *new)
diff -urN linux-2.5.68-bk9/net/irda/wrapper.c linux-2.5.68-bk10/net/irda/wrapper.c
--- linux-2.5.68-bk9/net/irda/wrapper.c	2003-04-19 19:50:34.000000000 -0700
+++ linux-2.5.68-bk10/net/irda/wrapper.c	2003-04-30 04:34:58.000000000 -0700
@@ -267,7 +267,7 @@
 /*
  * Function async_unwrap_bof(dev, byte)
  *
- *    Handle Beggining Of Frame character received within a frame
+ *    Handle Beginning Of Frame character received within a frame
  *
  */
 static inline void
@@ -386,7 +386,7 @@
 	case BEGIN_FRAME:
 	case INSIDE_FRAME:
 	default:
-		/* Stuffed byte comming */
+		/* Stuffed byte coming */
 		rx_buff->state = LINK_ESCAPE;
 		break;
 	}
diff -urN linux-2.5.68-bk9/net/key/af_key.c linux-2.5.68-bk10/net/key/af_key.c
--- linux-2.5.68-bk9/net/key/af_key.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk10/net/key/af_key.c	2003-04-30 04:34:58.000000000 -0700
@@ -63,8 +63,6 @@
 	kfree(pfkey_sk(sk));
 
 	atomic_dec(&pfkey_socks_nr);
-
-	MOD_DEC_USE_COUNT;
 }
 
 static void pfkey_table_grab(void)
@@ -150,8 +148,6 @@
 	if (protocol != PF_KEY_V2)
 		return -EPROTONOSUPPORT;
 
-	MOD_INC_USE_COUNT;
-
 	err = -ENOMEM;
 	sk = sk_alloc(PF_KEY, GFP_KERNEL, 1, NULL);
 	if (sk == NULL)
@@ -176,9 +172,7 @@
 	pfkey_insert(sk);
 
 	return 0;
-
 out:
-	MOD_DEC_USE_COUNT;
 	return err;
 }
 
@@ -2792,6 +2786,7 @@
 static struct net_proto_family pfkey_family_ops = {
 	.family	=	PF_KEY,
 	.create	=	pfkey_create,
+	.owner	=	THIS_MODULE,
 };
 
 #ifdef CONFIG_PROC_FS
diff -urN linux-2.5.68-bk9/net/llc/af_llc.c linux-2.5.68-bk10/net/llc/af_llc.c
--- linux-2.5.68-bk9/net/llc/af_llc.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/llc/af_llc.c	2003-04-30 04:34:58.000000000 -0700
@@ -193,9 +193,9 @@
 }
 
 /**
- *	llc_ui_autoport - provide dynamicly allocate SAP number
+ *	llc_ui_autoport - provide dynamically allocate SAP number
  *
- *	Provide the caller with a dynamicly allocated SAP number according
+ *	Provide the caller with a dynamically allocated SAP number according
  *	to the rules that are set in this function. Returns: 0, upon failure,
  *	SAP number otherwise.
  */
diff -urN linux-2.5.68-bk9/net/llc/llc_conn.c linux-2.5.68-bk10/net/llc/llc_conn.c
--- linux-2.5.68-bk9/net/llc/llc_conn.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/net/llc/llc_conn.c	2003-04-30 04:34:58.000000000 -0700
@@ -344,7 +344,7 @@
  *	llc_conn_send_pdus - Sends queued PDUs
  *	@sk: active connection
  *
- *	Sends queued pdus to MAC layer for transmition.
+ *	Sends queued pdus to MAC layer for transmission.
  */
 static void llc_conn_send_pdus(struct sock *sk)
 {
diff -urN linux-2.5.68-bk9/net/llc/llc_main.c linux-2.5.68-bk10/net/llc/llc_main.c
--- linux-2.5.68-bk9/net/llc/llc_main.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/llc/llc_main.c	2003-04-30 04:34:58.000000000 -0700
@@ -162,7 +162,7 @@
 
 /**
  *     llc_sk_init - Initializes a socket with default llc values.
- *     @sk: socket to intiailize.
+ *     @sk: socket to initialize.
  *
  *     Initializes a socket with default llc values.
  */
diff -urN linux-2.5.68-bk9/net/netrom/af_netrom.c linux-2.5.68-bk10/net/netrom/af_netrom.c
--- linux-2.5.68-bk9/net/netrom/af_netrom.c	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk10/net/netrom/af_netrom.c	2003-04-30 04:34:58.000000000 -0700
@@ -62,34 +62,25 @@
 
 static struct proto_ops nr_proto_ops;
 
-static void nr_free_sock(struct sock *sk)
-{
-	sk_free(sk);
-
-	MOD_DEC_USE_COUNT;
-}
-
 static struct sock *nr_alloc_sock(void)
 {
-	struct sock *sk;
 	nr_cb *nr;
+	struct sock *sk = sk_alloc(PF_NETROM, GFP_ATOMIC, 1, NULL);
 
-	MOD_INC_USE_COUNT;
-	if ((sk = sk_alloc(PF_NETROM, GFP_ATOMIC, 1, NULL)) == NULL)
-		goto decmod;
+	if (!sk)
+		goto out;
 
 	nr = nr_sk(sk) = kmalloc(sizeof(*nr), GFP_ATOMIC);
 	if (!nr)
 		goto frees;
 
 	memset(nr, 0x00, sizeof(*nr));
-
 	nr->sk = sk;
-
-out:	return sk;
-frees:	sk_free(sk);
+out:
+	return sk;
+frees:
+	sk_free(sk);
 	sk = NULL;
-decmod:	MOD_DEC_USE_COUNT;
 	goto out;
 }
 
@@ -300,9 +291,8 @@
 		sk->timer.function = nr_destroy_timer;
 		sk->timer.data     = (unsigned long)sk;
 		add_timer(&sk->timer);
-	} else {
-		nr_free_sock(sk);
-	}
+	} else
+		sk_free(sk);
 }
 
 /*
@@ -1232,6 +1222,7 @@
 static struct net_proto_family nr_family_ops = {
 	.family		=	PF_NETROM,
 	.create		=	nr_create,
+	.owner		=	THIS_MODULE,
 };
 
 static struct proto_ops nr_proto_ops = {
diff -urN linux-2.5.68-bk9/net/netrom/nr_dev.c linux-2.5.68-bk10/net/netrom/nr_dev.c
--- linux-2.5.68-bk9/net/netrom/nr_dev.c	2003-04-19 19:51:07.000000000 -0700
+++ linux-2.5.68-bk10/net/netrom/nr_dev.c	2003-04-30 04:34:58.000000000 -0700
@@ -170,7 +170,6 @@
 
 static int nr_open(struct net_device *dev)
 {
-	MOD_INC_USE_COUNT;
 	netif_start_queue(dev);
 	ax25_listen_register((ax25_address *)dev->dev_addr, NULL);
 	return 0;
@@ -180,7 +179,6 @@
 {
 	netif_stop_queue(dev);
 	ax25_listen_release((ax25_address *)dev->dev_addr, NULL);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -199,6 +197,7 @@
 
 int nr_init(struct net_device *dev)
 {
+	SET_MODULE_OWNER(dev);
 	dev->mtu		= NR_MAX_PACKET_SIZE;
 	dev->hard_start_xmit	= nr_xmit;
 	dev->open		= nr_open;
diff -urN linux-2.5.68-bk9/net/packet/af_packet.c linux-2.5.68-bk10/net/packet/af_packet.c
--- linux-2.5.68-bk9/net/packet/af_packet.c	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk10/net/packet/af_packet.c	2003-04-30 04:34:58.000000000 -0700
@@ -209,7 +209,6 @@
 #ifdef PACKET_REFCNT_DEBUG
 	printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr));
 #endif
-	MOD_DEC_USE_COUNT;
 }
 
 
@@ -939,7 +938,6 @@
 		return -ESOCKTNOSUPPORT;
 
 	sock->state = SS_UNCONNECTED;
-	MOD_INC_USE_COUNT;
 
 	err = -ENOBUFS;
 	sk = sk_alloc(PF_PACKET, GFP_KERNEL, 1, NULL);
@@ -992,7 +990,6 @@
 out_free:
 	sk_free(sk);
 out:
-	MOD_DEC_USE_COUNT;
 	return err;
 }
 
@@ -1752,6 +1749,7 @@
 static struct net_proto_family packet_family_ops = {
 	.family =	PF_PACKET,
 	.create =	packet_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct notifier_block packet_netdev_notifier = {
diff -urN linux-2.5.68-bk9/net/rose/af_rose.c linux-2.5.68-bk10/net/rose/af_rose.c
--- linux-2.5.68-bk9/net/rose/af_rose.c	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk10/net/rose/af_rose.c	2003-04-30 04:34:58.000000000 -0700
@@ -124,22 +124,13 @@
 	return 0;
 }
 
-static void rose_free_sock(struct sock *sk)
-{
-	sk_free(sk);
-
-	MOD_DEC_USE_COUNT;
-}
-
 static struct sock *rose_alloc_sock(void)
 {
-	struct sock *sk;
 	rose_cb *rose;
+	struct sock *sk = sk_alloc(PF_ROSE, GFP_ATOMIC, 1, NULL);
 
-	MOD_INC_USE_COUNT;
-
-	if ((sk = sk_alloc(PF_ROSE, GFP_ATOMIC, 1, NULL)) == NULL)
-		goto decmod;
+	if (!sk)
+		goto out;
 
 	rose = rose_sk(sk) = kmalloc(sizeof(*rose), GFP_ATOMIC);
 	if (!rose)
@@ -147,10 +138,11 @@
 
 	memset(rose, 0x00, sizeof(*rose));
 	rose->sk = sk;
-out:	return sk;
-frees:	sk_free(sk);
+out:
+	return sk;
+frees:
+	sk_free(sk);
 	sk = NULL;
-decmod:	MOD_DEC_USE_COUNT;
 	goto out;
 }
 
@@ -380,9 +372,8 @@
 		sk->timer.function = rose_destroy_timer;
 		sk->timer.data     = (unsigned long)sk;
 		add_timer(&sk->timer);
-	} else {
-		rose_free_sock(sk);
-	}
+	} else
+		sk_free(sk);
 }
 
 /*
@@ -1428,6 +1419,7 @@
 static struct net_proto_family rose_family_ops = {
 	.family		=	PF_ROSE,
 	.create		=	rose_create,
+	.owner		=	THIS_MODULE,
 };
 
 static struct proto_ops rose_proto_ops = {
diff -urN linux-2.5.68-bk9/net/rose/rose_dev.c linux-2.5.68-bk10/net/rose/rose_dev.c
--- linux-2.5.68-bk9/net/rose/rose_dev.c	2003-04-19 19:48:55.000000000 -0700
+++ linux-2.5.68-bk10/net/rose/rose_dev.c	2003-04-30 04:34:58.000000000 -0700
@@ -135,7 +135,6 @@
 
 static int rose_open(struct net_device *dev)
 {
-	MOD_INC_USE_COUNT;
 	netif_start_queue(dev);
 	rose_add_loopback_node((rose_address *)dev->dev_addr);
 	return 0;
@@ -145,7 +144,6 @@
 {
 	netif_stop_queue(dev);
 	rose_del_loopback_node((rose_address *)dev->dev_addr);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -169,6 +167,7 @@
 
 int rose_init(struct net_device *dev)
 {
+	SET_MODULE_OWNER(dev);
 	dev->mtu		= ROSE_MAX_PACKET_SIZE - 2;
 	dev->hard_start_xmit	= rose_xmit;
 	dev->open		= rose_open;
diff -urN linux-2.5.68-bk9/net/sched/sch_cbq.c linux-2.5.68-bk10/net/sched/sch_cbq.c
--- linux-2.5.68-bk9/net/sched/sch_cbq.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sched/sch_cbq.c	2003-04-30 04:34:58.000000000 -0700
@@ -44,7 +44,7 @@
 	         Management Models for Packet Networks",
 		 IEEE/ACM Transactions on Networking, Vol.3, No.4, 1995
 
-	         [2] Sally Floyd, "Notes on CBQ and Guaranted Service", 1995
+	         [2] Sally Floyd, "Notes on CBQ and Guaranteed Service", 1995
 
 	         [3] Sally Floyd, "Notes on Class-Based Queueing: Setting
 		 Parameters", 1996
@@ -106,7 +106,7 @@
 	u32			defmap;
 
 	/* Link-sharing scheduler parameters */
-	long			maxidle;	/* Class paramters: see below. */
+	long			maxidle;	/* Class parameters: see below. */
 	long			offtime;
 	long			minidle;
 	u32			avpkt;
@@ -998,7 +998,7 @@
 	if (q->tx_class) {
 		psched_tdiff_t incr2;
 		/* Time integrator. We calculate EOS time
-		   by adding expected packet transmittion time.
+		   by adding expected packet transmission time.
 		   If real time is greater, we warp artificial clock,
 		   so that:
 
diff -urN linux-2.5.68-bk9/net/sched/sch_csz.c linux-2.5.68-bk10/net/sched/sch_csz.c
--- linux-2.5.68-bk9/net/sched/sch_csz.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sched/sch_csz.c	2003-04-30 04:34:58.000000000 -0700
@@ -184,7 +184,7 @@
 	procedure for solving these equations.
 	See procedure csz_update(), that is a generalization of
 	the algorithm from S. Keshav's thesis Chapter 3
-	"Efficient Implementation of Fair Queeing".
+	"Efficient Implementation of Fair Queuing".
 
 	NOTES.
 
@@ -624,7 +624,7 @@
 
 	toks = -toks;
 
-	/* Remeber, that we should start watchdog */
+	/* Remember, that we should start watchdog */
 	if (toks < q->wd_expires)
 		q->wd_expires = toks;
 
diff -urN linux-2.5.68-bk9/net/sched/sch_htb.c linux-2.5.68-bk10/net/sched/sch_htb.c
--- linux-2.5.68-bk9/net/sched/sch_htb.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sched/sch_htb.c	2003-04-30 04:34:58.000000000 -0700
@@ -765,7 +765,7 @@
 #endif
 
 /**
- * htb_charge_class - charges ammount "bytes" to leaf and ancestors
+ * htb_charge_class - charges amount "bytes" to leaf and ancestors
  *
  * Routine assumes that packet "bytes" long was dequeued from leaf cl
  * borrowing from "level". It accounts bytes to ceil leaky bucket for
diff -urN linux-2.5.68-bk9/net/sched/sch_red.c linux-2.5.68-bk10/net/sched/sch_red.c
--- linux-2.5.68-bk9/net/sched/sch_red.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sched/sch_red.c	2003-04-30 04:34:58.000000000 -0700
@@ -61,7 +61,7 @@
 
 	avg = (1-W)*avg + W*current_queue_len,
 
-	W is the filter time constant (choosen as 2^(-Wlog)), it controls
+	W is the filter time constant (chosen as 2^(-Wlog)), it controls
 	the inertia of the algorithm. To allow larger bursts, W should be
 	decreased.
 
diff -urN linux-2.5.68-bk9/net/sctp/adler32.c linux-2.5.68-bk10/net/sctp/adler32.c
--- linux-2.5.68-bk9/net/sctp/adler32.c	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/adler32.c	2003-04-30 04:34:58.000000000 -0700
@@ -73,7 +73,7 @@
 
 /* Performance work as shown this pig to be the
  * worst CPU wise guy. I have done what I could think
- * of on my flight to Austrialia but I am sure some
+ * of on my flight to Australia but I am sure some
  * clever assembly could speed this up, but of
  * course this would require the dreaded #ifdef's for
  * architecture. If you can speed this up more, pass
@@ -105,7 +105,7 @@
 		/* first we add */
 		s2 = (s2 + s1);
 
-		/* again, it is more efficent (it seems) to
+		/* again, it is more efficient (it seems) to
 		 * subtract since the most s2 will ever be
 		 * is (BASE-1 + BASE-1) in the worse case.
 		 * This would then be (2 * BASE) - 2, which
diff -urN linux-2.5.68-bk9/net/sctp/associola.c linux-2.5.68-bk10/net/sctp/associola.c
--- linux-2.5.68-bk9/net/sctp/associola.c	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/associola.c	2003-04-30 04:34:58.000000000 -0700
@@ -88,7 +88,7 @@
 	return NULL;
 }
 
-/* Intialize a new association from provided memory. */
+/* Initialize a new association from provided memory. */
 sctp_association_t *sctp_association_init(sctp_association_t *asoc,
 					  const sctp_endpoint_t *ep,
 					  const struct sock *sk,
diff -urN linux-2.5.68-bk9/net/sctp/ipv6.c linux-2.5.68-bk10/net/sctp/ipv6.c
--- linux-2.5.68-bk9/net/sctp/ipv6.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/ipv6.c	2003-04-30 04:34:58.000000000 -0700
@@ -842,10 +842,10 @@
 	inet6_register_protosw(&sctpv6_seqpacket_protosw);
 	inet6_register_protosw(&sctpv6_stream_protosw);
 
-	/* Register the SCTP specfic PF_INET6 functions. */
+	/* Register the SCTP specific PF_INET6 functions. */
 	sctp_register_pf(&sctp_pf_inet6_specific, PF_INET6);
 
-	/* Register the SCTP specfic AF_INET6 functions. */
+	/* Register the SCTP specific AF_INET6 functions. */
 	sctp_register_af(&sctp_ipv6_specific);
 
 	/* Register notifier for inet6 address additions/deletions. */
diff -urN linux-2.5.68-bk9/net/sctp/protocol.c linux-2.5.68-bk10/net/sctp/protocol.c
--- linux-2.5.68-bk9/net/sctp/protocol.c	2003-04-19 19:50:01.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/protocol.c	2003-04-30 04:34:58.000000000 -0700
@@ -380,7 +380,7 @@
 
 /* Returns a valid dst cache entry for the given source and destination ip
  * addresses. If an association is passed, trys to get a dst entry with a
- * source adddress that matches an address in the bind address list.
+ * source address that matches an address in the bind address list.
  */
 struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
 				  union sctp_addr *daddr,
diff -urN linux-2.5.68-bk9/net/sctp/sm_make_chunk.c linux-2.5.68-bk10/net/sctp/sm_make_chunk.c
--- linux-2.5.68-bk9/net/sctp/sm_make_chunk.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/sm_make_chunk.c	2003-04-30 04:34:58.000000000 -0700
@@ -91,7 +91,7 @@
 	}
 };
 
-/* A helper to initilize to initilize an op error inside a
+/* A helper to initialize to initialize an op error inside a
  * provided chunk, as most cause codes will be embedded inside an
  * abort chunk.
  */
diff -urN linux-2.5.68-bk9/net/sctp/sm_sideeffect.c linux-2.5.68-bk10/net/sctp/sm_sideeffect.c
--- linux-2.5.68-bk9/net/sctp/sm_sideeffect.c	2003-04-19 19:50:07.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/sm_sideeffect.c	2003-04-30 04:34:58.000000000 -0700
@@ -635,7 +635,7 @@
 			sk->state_change(sk);
 	}
 
-	/* Change the sk->state of a TCP-style socket that has sucessfully
+	/* Change the sk->state of a TCP-style socket that has successfully
 	 * completed a connect() call.
 	 */
 	if ((SCTP_STATE_ESTABLISHED == asoc->state) &&
diff -urN linux-2.5.68-bk9/net/sctp/sm_statefuns.c linux-2.5.68-bk10/net/sctp/sm_statefuns.c
--- linux-2.5.68-bk9/net/sctp/sm_statefuns.c	2003-04-19 19:48:50.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/sm_statefuns.c	2003-04-30 04:34:58.000000000 -0700
@@ -445,7 +445,7 @@
 		}
 	}
 
-	/* Tag the variable length paramters.  Note that we never
+	/* Tag the variable length parameters.  Note that we never
 	 * convert the parameters in an INIT chunk.
 	 */
 	chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t));
@@ -1345,7 +1345,7 @@
  * set to 0 (indicating that no previous TCB existed).  The INIT ACK and
  * State Cookie are populated as specified in section 5.2.1.
  *
- * Verification Tag: Not specifed, but an INIT has no way of knowing
+ * Verification Tag: Not specified, but an INIT has no way of knowing
  * what the verification tag could be, so we ignore it.
  *
  * Inputs
@@ -1505,7 +1505,7 @@
  *     INIT-ACK and finally sent a COOKIE ECHO with the peer's same tag
  *     but a new tag of its own.
  */
-/* This case represents an intialization collision.  */
+/* This case represents an initialization collision.  */
 static sctp_disposition_t sctp_sf_do_dupcook_c(const sctp_endpoint_t *ep,
 					       const sctp_association_t *asoc,
 					       sctp_chunk_t *chunk,
@@ -1526,7 +1526,7 @@
  * D) When both local and remote tags match the endpoint should always
  *    enter the ESTABLISHED state, if it has not already done so.
  */
-/* This case represents an intialization collision.  */
+/* This case represents an initialization collision.  */
 static sctp_disposition_t sctp_sf_do_dupcook_d(const sctp_endpoint_t *ep,
 					       const sctp_association_t *asoc,
 					       sctp_chunk_t *chunk,
diff -urN linux-2.5.68-bk9/net/sctp/socket.c linux-2.5.68-bk10/net/sctp/socket.c
--- linux-2.5.68-bk9/net/sctp/socket.c	2003-04-19 19:51:23.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/socket.c	2003-04-30 04:34:58.000000000 -0700
@@ -2854,7 +2854,7 @@
 	return pp;
 }
 
-/* FIXME: Commments! */
+/* FIXME: Comments! */
 static __inline__ void __sctp_put_port(struct sock *sk)
 {
 	struct sctp_protocol *sctp_proto = sctp_get_protocol();
diff -urN linux-2.5.68-bk9/net/sctp/transport.c linux-2.5.68-bk10/net/sctp/transport.c
--- linux-2.5.68-bk9/net/sctp/transport.c	2003-04-19 19:48:54.000000000 -0700
+++ linux-2.5.68-bk10/net/sctp/transport.c	2003-04-30 04:34:58.000000000 -0700
@@ -78,7 +78,7 @@
 	return NULL;
 }
 
-/* Intialize a new transport from provided memory.  */
+/* Initialize a new transport from provided memory.  */
 struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
 					   const union sctp_addr *addr,
 					   int priority)
@@ -171,7 +171,7 @@
 }
 
 /* Start T3_rtx timer if it is not already running and update the heartbeat
- * timer.  This routine is called everytime a DATA chunk is sent.
+ * timer.  This routine is called every time a DATA chunk is sent.
  */
 void sctp_transport_reset_timers(struct sctp_transport *transport)
 {
diff -urN linux-2.5.68-bk9/net/socket.c linux-2.5.68-bk10/net/socket.c
--- linux-2.5.68-bk9/net/socket.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/socket.c	2003-04-30 04:34:58.000000000 -0700
@@ -1091,7 +1091,7 @@
 
 	sock->type  = type;
 
-	i = -EBUSY;
+	i = -EAFNOSUPPORT;
 	if (!net_family_get(family))
 		goto out_release;
 
@@ -1288,7 +1288,7 @@
 	if (err)
 		goto out_release;
 
-	err = -EBUSY;
+	err = -EAFNOSUPPORT;
 	if (!net_family_get(sock->ops->family))
 		goto out_release;
 
diff -urN linux-2.5.68-bk9/net/sunrpc/cache.c linux-2.5.68-bk10/net/sunrpc/cache.c
--- linux-2.5.68-bk9/net/sunrpc/cache.c	2003-04-19 19:49:57.000000000 -0700
+++ linux-2.5.68-bk10/net/sunrpc/cache.c	2003-04-30 04:34:58.000000000 -0700
@@ -477,7 +477,7 @@
  *
  * Implemented by linked list of requests.  Each open file has 
  * a ->private that also exists in this list.  New request are added
- * to the end and may wakeup and preceeding readers.
+ * to the end and may wakeup and preceding readers.
  * New readers are added to the head.  If, on read, an item is found with
  * CACHE_UPCALLING clear, we free it from the list.
  *
diff -urN linux-2.5.68-bk9/net/sunrpc/svcsock.c linux-2.5.68-bk10/net/sunrpc/svcsock.c
--- linux-2.5.68-bk9/net/sunrpc/svcsock.c	2003-04-19 19:48:51.000000000 -0700
+++ linux-2.5.68-bk10/net/sunrpc/svcsock.c	2003-04-30 04:34:58.000000000 -0700
@@ -1469,7 +1469,7 @@
 }
 
 /*
- * recv data from a defered request into an active one
+ * recv data from a deferred request into an active one
  */
 static int svc_deferred_recv(struct svc_rqst *rqstp)
 {
diff -urN linux-2.5.68-bk9/net/unix/af_unix.c linux-2.5.68-bk10/net/unix/af_unix.c
--- linux-2.5.68-bk9/net/unix/af_unix.c	2003-04-30 04:34:51.000000000 -0700
+++ linux-2.5.68-bk10/net/unix/af_unix.c	2003-04-30 04:34:58.000000000 -0700
@@ -1512,7 +1512,7 @@
 		   - do not return fds - good, but too simple 8)
 		   - return fds, and do not return them on read (old strategy,
 		     apparently wrong)
-		   - clone fds (I choosed it for now, it is the most universal
+		   - clone fds (I chose it for now, it is the most universal
 		     solution)
 		
 	           POSIX 1003.1g does not actually define this clearly
diff -urN linux-2.5.68-bk9/net/wanrouter/af_wanpipe.c linux-2.5.68-bk10/net/wanrouter/af_wanpipe.c
--- linux-2.5.68-bk9/net/wanrouter/af_wanpipe.c	2003-04-19 19:51:13.000000000 -0700
+++ linux-2.5.68-bk10/net/wanrouter/af_wanpipe.c	2003-04-30 04:34:58.000000000 -0700
@@ -113,7 +113,7 @@
  *      function, wanpipe_rcv() to queue the incoming packets
  *      into an AF_WANPIPE socket queue.  Based on wanpipe_rcv()
  *      return code, the driver knows whether the packet was
- *      sucessfully queued.  If the socket queue is full, 
+ *      successfully queued.  If the socket queue is full, 
  *      protocol flow control is used by the driver, if any, 
  *      to slow down the traffic until the sock queue is free.
  *
@@ -217,7 +217,7 @@
  *
  *	Wanpipe socket bottom half handler.  This function
  *      is called by the WANPIPE device drivers to queue a
- *      incomming packet into the socket receive queue. 
+ *      incoming packet into the socket receive queue. 
  *      Once the packet is queued, all processes waiting to 
  *      read are woken up.
  *
@@ -298,7 +298,7 @@
  *
  *	Wanpipe LISTEN socket bottom half handler.  This function
  *      is called by the WANPIPE device drivers to queue an
- *      incomming call into the socket listening queue. 
+ *      incoming call into the socket listening queue. 
  *      Once the packet is queued, the waiting accept() process 
  *      is woken up.
  *
@@ -509,8 +509,6 @@
 	wan_opt->tx_timer.data	   = (unsigned long)sk;
 	wan_opt->tx_timer.function = wanpipe_delayed_transmit;
 
-	MOD_INC_USE_COUNT;
-
 	sock_init_data(NULL, sk);
 	return sk;
 }
@@ -739,7 +737,7 @@
  *
  *	Execute x25api commands.  The atomic variable
  *      chan->command is used to indicate to the driver that
- *      command is pending for exection.  The acutal command
+ *      command is pending for execution.  The acutal command
  *      structure is placed into a sock mbox structure 
  *      (wp_sk(sk)->mbox).
  *
@@ -846,7 +844,6 @@
 		}
 		sock_put(sk);
 		atomic_dec(&wanpipe_socks_nr);
-		MOD_DEC_USE_COUNT;
 		return;
 	}
 
@@ -1032,7 +1029,6 @@
 	}
 	sock_put(sk);
 	atomic_dec(&wanpipe_socks_nr);
-	MOD_DEC_USE_COUNT;
 	return 0;
 }
 
@@ -1135,7 +1131,7 @@
 	if (!sk)
 		return;
 
-	/* This functin can be called from interrupt. We must use
+	/* This function can be called from interrupt. We must use
 	 * appropriate locks */
 	
 	if (test_bit(1,&wanpipe_tx_critical)){
@@ -1197,7 +1193,6 @@
 	}
 	sock_put(sk);
 	atomic_dec(&wanpipe_socks_nr);
-	MOD_DEC_USE_COUNT;
 	return;
 }
 
@@ -1209,7 +1204,7 @@
 	if (!sk)
 		return;
 
-	/* This functin can be called from interrupt. We must use
+	/* This function can be called from interrupt. We must use
 	 * appropriate locks */
 	
 	write_lock(&wanpipe_sklist_lock);
@@ -1237,7 +1232,6 @@
 	}
 	sock_put(sk);
 	atomic_dec(&wanpipe_socks_nr);
-	MOD_DEC_USE_COUNT;
 	return;
 }
 
@@ -1262,8 +1256,6 @@
 	}
 	sock_put(sk);
 	atomic_dec(&wanpipe_socks_nr);
-	MOD_DEC_USE_COUNT;
-	return;
 }
 
 
@@ -2579,6 +2571,7 @@
 static struct net_proto_family wanpipe_family_ops = {
 	.family = PF_WANPIPE,
 	.create = wanpipe_create,
+	.owner	= THIS_MODULE,
 };
 
 struct notifier_block wanpipe_netdev_notifier = {
diff -urN linux-2.5.68-bk9/net/x25/af_x25.c linux-2.5.68-bk10/net/x25/af_x25.c
--- linux-2.5.68-bk9/net/x25/af_x25.c	2003-04-19 19:51:12.000000000 -0700
+++ linux-2.5.68-bk10/net/x25/af_x25.c	2003-04-30 04:34:58.000000000 -0700
@@ -359,10 +359,8 @@
 		sk->timer.function = x25_destroy_timer;
 		sk->timer.data     = (unsigned long)sk;
 		add_timer(&sk->timer);
-	} else {
+	} else
 		sk_free(sk);
-		MOD_DEC_USE_COUNT;
-	}
 	release_sock(sk);
 	sock_put(sk);
 }
@@ -442,13 +440,11 @@
 
 static struct sock *x25_alloc_socket(void)
 {
-	struct sock *sk;
 	struct x25_opt *x25;
+	struct sock *sk = sk_alloc(AF_X25, GFP_ATOMIC, 1, NULL);
 
-	MOD_INC_USE_COUNT;
-
-	if ((sk = sk_alloc(AF_X25, GFP_ATOMIC, 1, NULL)) == NULL)
-		goto decmod;
+	if (!sk)
+		goto out;
 
 	x25 = x25_sk(sk) = kmalloc(sizeof(*x25), GFP_ATOMIC);
 	if (!x25)
@@ -469,8 +465,6 @@
 frees:
 	sk_free(sk);
 	sk = NULL;
-decmod:
-	MOD_DEC_USE_COUNT;
 	goto out;
 }
 
@@ -1324,6 +1318,7 @@
 struct net_proto_family x25_family_ops = {
 	.family =	AF_X25,
 	.create =	x25_create,
+	.owner	=	THIS_MODULE,
 };
 
 static struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
