From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core update for 2.6.6-rc1
Date: Thu, 15 Apr 2004 10:41:53 -0700 [thread overview]
Message-ID: <10820509132396@kroah.com> (raw)
In-Reply-To: <1082050913417@kroah.com>
ChangeSet 1.1643.36.14, 2004/04/09 11:32:55-07:00, marcel@holtmann.org
[PATCH] Add sysfs class support for CAPI
here is a patch that adds class support to the ISDN CAPI module. Without
it udev won't create the /dev/capi20 device node.
drivers/isdn/capi/capi.c | 14 ++++++++++++++
1 files changed, 14 insertions(+)
diff -Nru a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
--- a/drivers/isdn/capi/capi.c Thu Apr 15 10:20:26 2004
+++ b/drivers/isdn/capi/capi.c Thu Apr 15 10:20:26 2004
@@ -37,6 +37,7 @@
#include <linux/capi.h>
#include <linux/kernelcapi.h>
#include <linux/init.h>
+#include <linux/device.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/isdn/capiutil.h>
#include <linux/isdn/capicmd.h>
@@ -56,6 +57,8 @@
/* -------- driver information -------------------------------------- */
+static struct class_simple *capi_class;
+
int capi_major = 68; /* allocated */
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
#define CAPINC_NR_PORTS 32
@@ -1479,11 +1482,20 @@
return -EIO;
}
+ capi_class = class_simple_create(THIS_MODULE, "capi");
+ if (IS_ERR(capi_class)) {
+ unregister_chrdev(capi_major, "capi20");
+ return PTR_ERR(capi_class);
+ }
+
+ class_simple_device_add(capi_class, MKDEV(capi_major, 0), NULL, "capi20");
devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
"isdn/capi20");
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) {
+ class_simple_device_remove(MKDEV(capi_major, 0));
+ class_simple_destroy(capi_class);
unregister_chrdev(capi_major, "capi20");
return -ENOMEM;
}
@@ -1510,6 +1522,8 @@
{
proc_exit();
+ class_simple_device_remove(MKDEV(capi_major, 0));
+ class_simple_destroy(capi_class);
unregister_chrdev(capi_major, "capi20");
devfs_remove("isdn/capi20");
next prev parent reply other threads:[~2004-04-15 17:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-15 17:35 [BK PATCH] Driver Core update for 2.6.6-rc1 Greg KH
2004-04-15 17:41 ` [PATCH] " Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH [this message]
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
2004-04-15 17:41 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10820509132396@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.