public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* updated sbpcd.c
@ 2007-06-29  2:47 Surya Prabhakar N
  2007-06-29  2:49 ` Rene Herman
  2007-06-29  6:32 ` Eberhard Moenkeberg
  0 siblings, 2 replies; 4+ messages in thread
From: Surya Prabhakar N @ 2007-06-29  2:47 UTC (permalink / raw)
  To: emoenke; +Cc: linux-kernel, Jesper Juhl

Hi emoenke,
   Can this patch be verified and pulled into your tree.

thanks.
Surya.



From: Jesper Juhl <jesper.juhl@gmail.com>
To: Surya <surya.prabhakar@wipro.com>
Cc: , Linux Kernel <linux-kernel@vger.kernel.org>,
kernel-janitors@lists.osdl.org
Subject: Re: [PATCH]: check_region cleanup in sbpcd.c
Date: Tue, 26 Jun 2007 01:07:41 +0200

On 12/06/07, Surya <surya.prabhakar@wipro.com> wrote:
[snip]
> >
> I am sending with all the corrections, if its ok to acknowledge it?
>
Looks good to me.

>
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
Reviewed-by: Jesper Juhl <jesper.juhl@gmail.com>



----snip------

Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
--- 

diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index a1283b1..5414172 100644
--- a/drivers/cdrom/sbpcd.c
+++ b/drivers/cdrom/sbpcd.c
@@ -358,6 +358,9 @@
  * Add bio/kdev_t changes for 2.5.x required to make it work again. 
  * Still room for improvement in the request handling here if anyone
  * actually cares.  Bring your own chainsaw.    Paul G.  02/2002
+ *
+ * Deprecated check_region cleanup to request_region 
+ *				-Surya Prabhakar N    08/07/2007
  */
 

@@ -555,6 +558,7 @@ static struct cdrom_read_audio read_audio;
 static unsigned char msgnum;
 static char msgbuf[80];
 
+static int addr[2] = {1, CDROM_PORT};
 static int max_drives = MAX_DRIVES;
 module_param(max_drives, int, 0);
 #ifndef MODULE
@@ -5638,7 +5642,6 @@ int __init sbpcd_init(void)
 #endif
 {
 	int i=0, j=0;
-	int addr[2]={1, CDROM_PORT};
 	int port_index;
 
 	sti();
@@ -5670,9 +5673,9 @@ int __init sbpcd_init(void)
 	{
 		addr[1]=sbpcd[port_index];
 		if (addr[1]==0) break;
-		if (check_region(addr[1],4))
+		if (!request_region(addr[1],4, "sbpcd driver"))
 		{
-			msg(DBG_INF,"check_region: %03X is not free.\n",addr[1]);
+			msg(DBG_INF,"request_region: %03X is not free.\n",addr[1]);
 			continue;
 		}
 		if (sbpcd[port_index+1]==2) type=str_sp;
@@ -5699,6 +5702,7 @@ int __init sbpcd_init(void)
 	if (ndrives==0)
 	{
 		msg(DBG_INF, "No drive found.\n");
+		release_region(addr[1],4);
 #ifdef MODULE
 		return -EIO;
 #else
@@ -5775,6 +5779,7 @@ int __init sbpcd_init(void)
 	if (!request_region(CDo_command,4,major_name))
 	{
 		printk(KERN_WARNING "sbpcd: Unable to request region 0x%x\n", CDo_command);
+		release_region(addr[1],4);
 		return -EIO;
 	}
 
@@ -5788,6 +5793,8 @@ int __init sbpcd_init(void)
 #endif /* SOUND_BASE */
 
 	if (register_blkdev(MAJOR_NR, major_name)) {
+		release_region(CDo_command,4);
+		release_region(addr[1],4);
 #ifdef MODULE
 		return -EIO;
 #else
@@ -5801,6 +5808,7 @@ int __init sbpcd_init(void)
 	sbpcd_queue = blk_init_queue(do_sbpcd_request, &sbpcd_lock);
 	if (!sbpcd_queue) {
 		release_region(CDo_command,4);
+		release_region(addr[1],4);
 		unregister_blkdev(MAJOR_NR, major_name);
 		return -ENOMEM;
 	}
@@ -5834,6 +5842,7 @@ int __init sbpcd_init(void)
 				printk("Can't unregister %s\n", major_name);
 			}
 			release_region(CDo_command,4);
+			release_region(addr[1],4);
 			blk_cleanup_queue(sbpcd_queue);
 			return -EIO;
 		}
@@ -5850,6 +5859,7 @@ int __init sbpcd_init(void)
 		if (sbpcd_infop == NULL)
 		{
                         release_region(CDo_command,4);
+			release_region(addr[1],4);
 			blk_cleanup_queue(sbpcd_queue);
                         return -ENOMEM;
 		}
@@ -5894,6 +5904,7 @@ static void sbpcd_exit(void)
 		return;
 	}
 	release_region(CDo_command,4);
+	release_region(addr[1],4);
 	blk_cleanup_queue(sbpcd_queue);
 	for (j=0;j<NR_SBPCD;j++)
 	{

-surya.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: updated sbpcd.c
  2007-06-29  2:47 updated sbpcd.c Surya Prabhakar N
@ 2007-06-29  2:49 ` Rene Herman
  2007-06-29  6:32 ` Eberhard Moenkeberg
  1 sibling, 0 replies; 4+ messages in thread
From: Rene Herman @ 2007-06-29  2:49 UTC (permalink / raw)
  To: surya.prabhakar; +Cc: emoenke, linux-kernel, Jesper Juhl

On 06/29/2007 04:47 AM, Surya Prabhakar N wrote:

> Hi emoenke,
>    Can this patch be verified and pulled into your tree.

You (and he) may not particularly care -- these old drivers are going to be 
removed for 2.6.23: http://lkml.org/lkml/2007/6/21/34

Rene.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: updated sbpcd.c
  2007-06-29  2:47 updated sbpcd.c Surya Prabhakar N
  2007-06-29  2:49 ` Rene Herman
@ 2007-06-29  6:32 ` Eberhard Moenkeberg
  2007-06-29  9:14   ` Jesper Juhl
  1 sibling, 1 reply; 4+ messages in thread
From: Eberhard Moenkeberg @ 2007-06-29  6:32 UTC (permalink / raw)
  To: Surya Prabhakar N; +Cc: linux-kernel, Jesper Juhl

[-- Attachment #1: Type: TEXT/PLAIN, Size: 329 bytes --]

Hi,

On Fri, 29 Jun 2007, Surya Prabhakar N wrote:

> 
> Hi emoenke,
>    Can this patch be verified and pulled into your tree.
> 
> thanks.
> Surya.

Jesper Juhl should ack it (if), and Jens Axboe would be the right person 
to pull it into the tree.


Viele Grüße
Eberhard Mönkeberg (emoenke@gwdg.de, em@kki.org)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: updated sbpcd.c
  2007-06-29  6:32 ` Eberhard Moenkeberg
@ 2007-06-29  9:14   ` Jesper Juhl
  0 siblings, 0 replies; 4+ messages in thread
From: Jesper Juhl @ 2007-06-29  9:14 UTC (permalink / raw)
  To: Eberhard Moenkeberg; +Cc: Surya Prabhakar N, linux-kernel

On 29/06/07, Eberhard Moenkeberg <emoenke@gwdg.de> wrote:
> Hi,
>
> On Fri, 29 Jun 2007, Surya Prabhakar N wrote:
>
> >
> > Hi emoenke,
> >    Can this patch be verified and pulled into your tree.
> >
> > thanks.
> > Surya.
>
> Jesper Juhl should ack it (if), and Jens Axboe would be the right person
> to pull it into the tree.
>
Consider Surya's patch to be
Acked-by: Jesper Juhl <jesper.juhl@gmail.com>

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-29  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-29  2:47 updated sbpcd.c Surya Prabhakar N
2007-06-29  2:49 ` Rene Herman
2007-06-29  6:32 ` Eberhard Moenkeberg
2007-06-29  9:14   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox