* [PATCH 2.5.68] Convert elan-104nc to remove check_region().
@ 2003-05-02 20:42 Bob Miller
2003-05-05 4:38 ` Rusty Russell
0 siblings, 1 reply; 4+ messages in thread
From: Bob Miller @ 2003-05-02 20:42 UTC (permalink / raw)
To: linux-kernel; +Cc: trivial
Moved the request_region() call to replace check_region() and adds
release_region()'s in the error paths that occure before the old
call to request_region(). NOTE: This patch just updates comments.
--
Bob Miller Email: rem@osdl.org
Open Source Development Lab Phone: 503.626.2455 Ext. 17
diff -Nru a/drivers/mtd/maps/elan-104nc.c b/drivers/mtd/maps/elan-104nc.c
--- a/drivers/mtd/maps/elan-104nc.c Fri May 2 09:52:22 2003
+++ b/drivers/mtd/maps/elan-104nc.c Fri May 2 09:52:22 2003
@@ -30,8 +30,8 @@
The single flash device is divided into 3 partition which appear as separate
MTD devices.
-Linux thinks that the I/O port is used by the PIC and hence check_region() will
-always fail. So we don't do it. I just hope it doesn't break anything.
+Linux thinks that the I/O port is used by the PIC and hence request_region()
+will always fail. So we don't do it. I just hope it doesn't break anything.
*/
#include <linux/module.h>
#include <linux/slab.h>
@@ -227,14 +227,14 @@
}
iounmap((void *)iomapadr);
- release_region(PAGE_IO,PAGE_IO_SIZE);
+ /* release_region(PAGE_IO,PAGE_IO_SIZE); */
}
int __init init_elan_104nc(void)
{
/* Urg! We use I/O port 0x22 without request_region()ing it */
/*
- if (check_region(PAGE_IO,PAGE_IO_SIZE) != 0) {
+ if (!request_region(PAGE_IO,PAGE_IO_SIZE, "ELAN-104NC flash")) {
printk( KERN_ERR"%s: IO ports 0x%x-0x%x in use\n",
elan_104nc_map.name,
PAGE_IO, PAGE_IO+PAGE_IO_SIZE-1 );
@@ -245,12 +245,11 @@
if (!iomapadr) {
printk( KERN_ERR"%s: failed to ioremap memory region\n",
elan_104nc_map.name );
+ /*
+ release_region(PAGE_IO,PAGE_IO_SIZE);
+ */
return -EIO;
}
-
- /*
- request_region( PAGE_IO, PAGE_IO_SIZE, "ELAN-104NC flash" );
- */
printk( KERN_INFO"%s: IO:0x%x-0x%x MEM:0x%x-0x%x\n",
elan_104nc_map.name,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.68] Convert elan-104nc to remove check_region().
2003-05-02 20:42 [PATCH 2.5.68] Convert elan-104nc to remove check_region() Bob Miller
@ 2003-05-05 4:38 ` Rusty Russell
2003-05-05 17:01 ` Bob Miller
0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2003-05-05 4:38 UTC (permalink / raw)
To: Bob Miller; +Cc: linux-kernel
In message <20030502204207.GB25713@doc.pdx.osdl.net> you write:
> Moved the request_region() call to replace check_region() and adds
> release_region()'s in the error paths that occure before the old
> call to request_region().
> NOTE: This patch just updates comments.
Actually. It doesn't.
And why this:
> @@ -227,14 +227,14 @@
> }
>
> iounmap((void *)iomapadr);
> - release_region(PAGE_IO,PAGE_IO_SIZE);
> + /* release_region(PAGE_IO,PAGE_IO_SIZE); */
> }
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.68] Convert elan-104nc to remove check_region().
2003-05-05 4:38 ` Rusty Russell
@ 2003-05-05 17:01 ` Bob Miller
2003-05-06 1:04 ` Rusty Russell
0 siblings, 1 reply; 4+ messages in thread
From: Bob Miller @ 2003-05-05 17:01 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel
All the request_region() calls in this driver (plus all the now removed
check_region()) calls are commented out because of conflicts with the PIC.
The release_region() call below was NOT commented out. If the driver
isn't really requsting the region it shouldn't be release it. So, I
commented it out.
On Mon, May 05, 2003 at 02:38:02PM +1000, Rusty Russell wrote:
> In message <20030502204207.GB25713@doc.pdx.osdl.net> you write:
> > Moved the request_region() call to replace check_region() and adds
> > release_region()'s in the error paths that occure before the old
> > call to request_region().
>
> > NOTE: This patch just updates comments.
>
> Actually. It doesn't.
>
> And why this:
>
> > @@ -227,14 +227,14 @@
> > }
> >
> > iounmap((void *)iomapadr);
> > - release_region(PAGE_IO,PAGE_IO_SIZE);
> > + /* release_region(PAGE_IO,PAGE_IO_SIZE); */
> > }
>
> Rusty.
> --
> Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
--
Bob Miller Email: rem@osdl.org
Open Source Development Lab Phone: 503.626.2455 Ext. 17
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.5.68] Convert elan-104nc to remove check_region().
2003-05-05 17:01 ` Bob Miller
@ 2003-05-06 1:04 ` Rusty Russell
0 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2003-05-06 1:04 UTC (permalink / raw)
To: Bob Miller; +Cc: linux-kernel
In message <20030505170118.GA17276@doc.pdx.osdl.net> you write:
> All the request_region() calls in this driver (plus all the now removed
> check_region()) calls are commented out because of conflicts with the PIC.
>
> The release_region() call below was NOT commented out. If the driver
> isn't really requsting the region it shouldn't be release it. So, I
> commented it out.
OK, agreed. I've replaced the original comment with the one above,
which is more appropriate.
Thanks!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-06 1:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02 20:42 [PATCH 2.5.68] Convert elan-104nc to remove check_region() Bob Miller
2003-05-05 4:38 ` Rusty Russell
2003-05-05 17:01 ` Bob Miller
2003-05-06 1:04 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).