public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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:52 -0700	[thread overview]
Message-ID: <10820509122120@kroah.com> (raw)
In-Reply-To: <10820509121457@kroah.com>

ChangeSet 1.1643.36.6, 2004/03/19 16:39:37-08:00, hannal@us.ibm.com

[PATCH] add class support to floppy tape driver zftape-init.c

Here is a patch to add class support to zftape-init.c:

MODULE_DESCRIPTION(ZFTAPE_VERSION " - "
                   "VFS interface for the Linux floppy tape driver. "
                   "Support for QIC-113 compatible volume table "
                   "and builtin compression (lzrw3 algorithm)");

I have verified it compiles but do not have the hardware to test it.


 drivers/char/ftape/zftape/zftape-init.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)


diff -Nru a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
--- a/drivers/char/ftape/zftape/zftape-init.c	Thu Apr 15 10:21:03 2004
+++ b/drivers/char/ftape/zftape/zftape-init.c	Thu Apr 15 10:21:03 2004
@@ -38,6 +38,7 @@
 
 #include <linux/zftape.h>
 #include <linux/init.h>
+#include <linux/device.h>
 
 #include "../zftape/zftape-init.h"
 #include "../zftape/zftape-read.h"
@@ -103,6 +104,8 @@
 	.release	= zft_close,
 };
 
+static struct class_simple *zft_class;
+
 /*      Open floppy tape device
  */
 static int zft_open(struct inode *ino, struct file *filep)
@@ -341,22 +344,29 @@
 	      "installing zftape VFS interface for ftape driver ...");
 	TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
 
+	zft_class = class_simple_create(THIS_MODULE, "zft");
 	for (i = 0; i < 4; i++) {
+		class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i);
 		devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i),
 				S_IFCHR | S_IRUSR | S_IWUSR,
 				"qft%i", i);
+		class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i);
 		devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4),
 				S_IFCHR | S_IRUSR | S_IWUSR,
 				"nqft%i", i);
+		class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i);
 		devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16),
 				S_IFCHR | S_IRUSR | S_IWUSR,
 				"zqft%i", i);
+		class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i);
 		devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20),
 				S_IFCHR | S_IRUSR | S_IWUSR,
 				"nzqft%i", i);
+		class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i);
 		devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32),
 				S_IFCHR | S_IRUSR | S_IWUSR,
 				"rawqft%i", i);
+		class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i);
 		devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36),
 				S_IFCHR | S_IRUSR | S_IWUSR,
 				"nrawqft%i", i);
@@ -386,12 +396,19 @@
 	}
         for (i = 0; i < 4; i++) {
 		devfs_remove("qft%i", i);
+		class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i));
 		devfs_remove("nqft%i", i);
+		class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 4));
 		devfs_remove("zqft%i", i);
+		class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 16));
 		devfs_remove("nzqft%i", i);
+		class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 20));
 		devfs_remove("rawqft%i", i);
+		class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 32));
 		devfs_remove("nrawqft%i", i);
+		class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 36));
 	}
+	class_simple_destroy(zft_class);
 	zft_uninit_mem(); /* release remaining memory, if any */
         printk(KERN_INFO "zftape successfully unloaded.\n");
 	TRACE_EXIT;


  reply	other threads:[~2004-04-15 18:09 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 [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
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

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=10820509122120@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox