public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bob Miller <rem@osdl.org>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.5.60 5/9] Update the Archimedes parallel port driver for new module API.
Date: Fri, 14 Feb 2003 16:37:00 -0800	[thread overview]
Message-ID: <20030215003700.GA13456@doc.pdx.osdl.net> (raw)
In-Reply-To: <m3el6agzw0.fsf@quimbies.gnus.org>

On Sat, Feb 15, 2003 at 01:18:23AM +0100, Lars Magne Ingebrigtsen wrote:
> Bob Miller <rem@osdl.org> writes:
> 
> > --- a/drivers/parport/parport_arc.c	Fri Feb 14 09:50:44 2003
> 
> [...]
> 
> > +	char *fake_name = "parport probe");
> 
> Surely that can't be correct?  (The parenthesis at the end there, I
> mean...)
> 
Sigh...  Corrected diff below...

-- 
Bob Miller					Email: rem@osdl.org
Open Source Development Lab			Phone: 503.626.2455 Ext. 17


diff -Nru a/drivers/parport/parport_arc.c b/drivers/parport/parport_arc.c
--- a/drivers/parport/parport_arc.c	Fri Feb 14 09:50:44 2003
+++ b/drivers/parport/parport_arc.c	Fri Feb 14 09:50:44 2003
@@ -65,18 +65,14 @@
 	return data_copy;
 }
 
-static void arc_inc_use_count(void)
+static int arc_inc_use_count(void)
 {
-#ifdef MODULE
-	MOD_INC_USE_COUNT;
-#endif
+	return try_module_get(THIS_MODULE);
 }
 
 static void arc_dec_use_count(void)
 {
-#ifdef MODULE
-	MOD_DEC_USE_COUNT;
-#endif
+	module_put(THIS_MODULE);
 }
 
 static struct parport_operations parport_arc_ops = 
@@ -123,18 +119,24 @@
 {
 	/* Archimedes hardware provides only one port, at a fixed address */
 	struct parport *p;
+	struct resource res;
+	char *fake_name = "parport probe";
 
-	if (check_region(PORT_BASE, 1))
+	res = request_region(PORT_BASE, 1, fake_name);
+	if (res == NULL)
 		return 0;
 
 	p = parport_register_port (PORT_BASE, IRQ_PRINTERACK,
 				   PARPORT_DMA_NONE, &parport_arc_ops);
 
-	if (!p)
+	if (!p) {
+		release_region(PORT_BASE, 1);
 		return 0;
+	}
 
 	p->modes = PARPORT_MODE_ARCSPP;
 	p->size = 1;
+	rename_region(res, p->name);
 
 	printk(KERN_INFO "%s: Archimedes on-board port, using irq %d\n",
 	       p->irq);


  parent reply	other threads:[~2003-02-15  0:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-14 23:53 [PATCH 2.5.60 5/9] Update the Archimedes parallel port driver for new module API Bob Miller
     [not found] ` <m3el6agzw0.fsf@quimbies.gnus.org>
2003-02-15  0:37   ` Bob Miller [this message]
2003-02-15 10:04     ` Russell King
2003-02-17  2:54       ` Rusty Russell
2003-02-17 17:03         ` Bob Miller

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=20030215003700.GA13456@doc.pdx.osdl.net \
    --to=rem@osdl.org \
    --cc=larsi@gnus.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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