{SPAM} Patch To Add Support For sysfs/udev 2.6
Gregory Hinton Nietsky <[email protected]>
| Newsgroups | gmane.linux.dazuko.devel |
|---|---|
| Message-ID | <[email protected]> |
here is a partner for my earlier patch for adding devfs support ...
it alows hotpluging of dazuko with udev/sysfs as this will be replacing devfs in the near future.
do enjoy ...
--- dazuko_linux26.c 2004-11-28 14:31:18.000000000 +0200
+++ dazuko_linux26.c.greg 2004-12-08 18:18:35.023900825 +0200
@@ -31,6 +31,7 @@
#include <linux/dcache.h>
#include <linux/mount.h>
#include <linux/devfs_fs_kernel.h>
+#include <linux/device.h>
#include <asm/uaccess.h>
ssize_t linux_dazuko_device_read(struct file *, char __user *, size_t, loff_t *);
@@ -39,6 +40,8 @@
int linux_dazuko_device_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long param);
int linux_dazuko_device_release(struct inode *, struct file *);
+static struct class_simple *dazuko_class = NULL;
+
static struct vfsmount *orig_rootmnt = NULL;
static struct dentry *orig_root = NULL;
static int dev_major = -1;
@@ -867,7 +870,8 @@
devfs_mk_cdev(MKDEV(dev_major, 0), S_IFCHR | S_IRUSR | S_IWUSR, DEVICE_NAME);
- /* initialization complete */
+ dazuko_class = class_simple_create(THIS_MODULE, "dazuko");
+ class_simple_device_add(dazuko_class,MKDEV(dev_major,0),NULL,"dazuko");
return 0;
}
@@ -878,6 +882,9 @@
devfs_remove(DEVICE_NAME);
+ class_simple_device_remove(MKDEV(dev_major,0));
+ class_simple_destroy(dazuko_class);
+
#ifdef NO_STACKING_SUPPORT
if (secondary_register)
mod_unreg_security(DEVICE_NAME, &dazuko_security_ops);
--
-------------
Gregory Hinton Nietsky
Email: [email protected]
Jabber: irroot <[email protected]>
Yahoo: gregnietsky
MSN: [email protected]
ICQ: 281096462 <irroot>
Gadu-Gadu: 5262483 <irroot>
AIM: irrootza
--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za