mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason Dravet" <dravet@hotmail.com>
To: jengelh@linux01.gwdg.de
Cc: linux-kernel@vger.kernel.org, linux-parport@lists.infradead.org
Subject: Re: RFC: add udev support to parport_pc
Date: Sat, 31 Dec 2005 13:22:33 -0600	[thread overview]
Message-ID: <BAY103-F29FBDD5808DA08FBB21D39DF2B0@phx.gbl> (raw)
In-Reply-To: <Pine.LNX.4.61.0512311830030.7910@yvahk01.tjqt.qr>

Here is version 2 of the patch.  It should address the issues pointed out so 
far.

Thanks,
Jason

--- /usr/src/linux-2.6.14/drivers/parport/parport_pc.c.orig	2005-12-30 
13:52:48.000000000 -0600
+++ /usr/src/linux-2.6.14/drivers/parport/parport_pc.c	2005-12-31 
13:17:42.000000000 -0600
@@ -14,6 +14,7 @@
  * More PCI support now conditional on CONFIG_PCI, 03/2001, Paul G.
  * Various hacks, Fred Barnes, 04/2001
  * Updated probing logic - Adam Belay <ambx1@neo.rr.com>
+ * Added sysfs and udev - Jason Dravet <dravet@hotmail.com>
  */

/* This driver should work with any hardware that is broadly compatible
@@ -55,6 +56,7 @@
#include <linux/pci.h>
#include <linux/pnp.h>
#include <linux/sysctl.h>
+#include <linux/sysfs.h>

#include <asm/io.h>
#include <asm/dma.h>
@@ -99,6 +101,9 @@ static struct superio_struct {	/* For Su
	int dma;
} superios[NR_SUPERIOS] __devinitdata = { {0,},};

+static struct class *parallel_class;
+int countports = 0;
+
static int user_specified;
#if defined(CONFIG_PARPORT_PC_SUPERIO) || \
        (defined(CONFIG_PARPORT_1284) && defined(CONFIG_PARPORT_PC_FIFO))
@@ -2232,6 +2237,11 @@ struct parport *parport_pc_probe_port (u
                                            is mandatory (see above) */
		p->dma = PARPORT_DMA_NONE;

+	parallel_class = class_create(THIS_MODULE, "lp");
+	class_device_create(parallel_class, NULL, MKDEV(6, countports), NULL, 
"lp%i", countports);
+	class_device_create(parallel_class, NULL, MKDEV(99, countports), NULL, 
"parport%i", countports);
+	countports++;
+
#ifdef CONFIG_PARPORT_PC_FIFO
	if (parport_ECP_supported(p) &&
	    p->dma != PARPORT_DMA_NOFIFO &&
@@ -3406,6 +3416,13 @@ static void __exit parport_pc_exit(void)
	if (pnp_registered_parport)
		pnp_unregister_driver (&parport_pc_pnp_driver);

+	printk (KERN_WARNING "countports = %i \n", countports);
+	for (countports--; countports >=0; countports--) {
+		printk (KERN_WARNING "countports loop = %i \n", countports);
+		class_device_destroy(parallel_class, MKDEV(99, countports));
+		class_device_destroy(parallel_class, MKDEV(6, countports));
+	}
+
	spin_lock(&ports_lock);
	while (!list_empty(&ports_list)) {
		struct parport_pc_private *priv;



  parent reply	other threads:[~2005-12-31 19:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-31 17:20 Jason Dravet
2005-12-31 17:38 ` Jan Engelhardt
2005-12-31 18:07   ` Jason Dravet
2005-12-31 20:50     ` Jan Engelhardt
2005-12-31 19:22   ` Jason Dravet [this message]
2005-12-31 17:59 ` Jiri Slaby
2005-12-31 18:14   ` Jason Dravet

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=BAY103-F29FBDD5808DA08FBB21D39DF2B0@phx.gbl \
    --to=dravet@hotmail.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parport@lists.infradead.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

all inboxes | Powered by JetHome®