From: "Gregory T. Norris" <haphazard@socket.net>
To: rio500-devel <rio500-devel@lists.sourceforge.net>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch] rio500 devfs support
Date: Sun, 24 Jun 2001 17:37:11 -0500 [thread overview]
Message-ID: <20010624173711.A1764@glitch.snoozer.net> (raw)
In-Reply-To: <20010619175224.A1137@glitch.snoozer.net>
In-Reply-To: <20010619175224.A1137@glitch.snoozer.net>
[-- Attachment #1.1: Type: text/plain, Size: 668 bytes --]
Here's an updated version of the patch - the only real difference is
that rio500.c will printk an error message if devfs_register() fails.
I left that out originally because devfs logs the error, but it's
probably a good idea to indicate which driver made the request.
Cheers!
On Tue, Jun 19, 2001 at 05:52:24PM -0500, Gregory T. Norris wrote:
> The attached diff adds devfs support to the rio500 driver, so that
> /dev/usb/rio500 gets created automagically. It was generated against
> 2.4.5, but probably applies fine against any recent kernel. Comments
> are welcome (but be gentle, this is my first attempt at a kernel
> patch :-).
>
> Cheers!
[-- Attachment #1.2: rio500-devfs-02.diff --]
[-- Type: text/plain, Size: 1207 bytes --]
diff -urN linux-2.4.5.orig/drivers/usb/rio500.c linux-2.4.5/drivers/usb/rio500.c
--- linux-2.4.5.orig/drivers/usb/rio500.c Sun Jun 24 16:29:35 2001
+++ linux-2.4.5/drivers/usb/rio500.c Sun Jun 24 16:45:08 2001
@@ -38,6 +38,7 @@
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
#include "rio500_usb.h"
@@ -70,6 +71,7 @@
};
static struct rio_usb_data rio_instance;
+static devfs_handle_t rio500_devfs_handle;
static int open_rio(struct inode *inode, struct file *file)
{
@@ -492,6 +494,14 @@
if (usb_register(&rio_driver) < 0)
return -1;
+ rio500_devfs_handle = devfs_register(NULL, "usb/rio500",
+ DEVFS_FL_DEFAULT,
+ USB_MAJOR, RIO_MINOR,
+ S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+ &usb_rio_fops, NULL);
+ if (rio500_devfs_handle == NULL)
+ printk(KERN_WARNING __FILE__ ": unable to register /dev/usb/rio500 with devfs\n");
+
info(DRIVER_VERSION " " DRIVER_AUTHOR);
info(DRIVER_DESC);
@@ -506,6 +516,8 @@
rio->present = 0;
usb_deregister(&rio_driver);
+ if (rio500_devfs_handle != NULL)
+ devfs_unregister(rio500_devfs_handle);
}
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
next prev parent reply other threads:[~2001-06-24 22:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-19 22:52 Gregory T. Norris
2001-06-24 22:37 ` Gregory T. Norris [this message]
2001-06-25 6:16 ` Richard Gooch
2001-06-25 11:43 ` Gregory T. Norris
2001-06-25 17:35 ` Greg KH
2001-06-25 22:12 ` Gregory T. Norris
2001-06-26 5:07 ` Greg KH
2001-07-01 20:55 ` Gregory T. Norris
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=20010624173711.A1764@glitch.snoozer.net \
--to=haphazard@socket.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rio500-devel@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®