Re: [PATCH] Add sysfs class support for CAPI

From: Marcel Holtmann
Date: Sat Apr 10 2004 - 15:17:46 EST


Hi Greg,

this patch fixes a bug in the CAPI TTY support, because the ->name value
of the TTY driver shouldn't contain a "/". After changing this there are
now a "capi20" TTY device and a "capi20" control device and so I renamed
the control device to "capi". The userspace visible part must be done by
udev and I added these two rules to restore the old namespace:

# CAPI devices
KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20"
KERNEL="capi*", NAME="capi/%n"

Regards

Marcel

===== drivers/isdn/capi/capi.c 1.52 vs edited =====
--- 1.52/drivers/isdn/capi/capi.c Sat Apr 10 22:04:37 2004
+++ edited/drivers/isdn/capi/capi.c Sat Apr 10 22:06:20 2004
@@ -1316,7 +1316,8 @@

drv->owner = THIS_MODULE;
drv->driver_name = "capi_nc";
- drv->name = "capi/";
+ drv->devfs_name = "capi/";
+ drv->name = "capi";
drv->major = capi_ttymajor;
drv->minor_start = 0;
drv->type = TTY_DRIVER_TYPE_SERIAL;
@@ -1492,7 +1493,7 @@
return PTR_ERR(capi_class);
}

- class_simple_device_add(capi_class, MKDEV(capi_major, 0), NULL, "capi20");
+ class_simple_device_add(capi_class, MKDEV(capi_major, 0), NULL, "capi");
devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
"isdn/capi20");