linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch][2/3] qlogic: call request_irq() with private data
@ 2003-10-16  1:53 Aristeu Sergio Rozanski Filho
  2003-10-16 11:30 ` Jeff Garzik
  2003-10-17 12:01 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Aristeu Sergio Rozanski Filho @ 2003-10-16  1:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Brard Roudier

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

-- 
aris


[-- Attachment #2: qlogic-request_irq.patch --]
[-- Type: text/plain, Size: 1052 bytes --]

--- linux/drivers/scsi/qlogicfas.c.orig	2003-10-15 23:42:15.000000000 -0200
+++ linux/drivers/scsi/qlogicfas.c	2003-10-15 23:44:11.000000000 -0200
@@ -667,9 +667,6 @@
 		qlirq = j;
 	} else
 		printk(KERN_INFO "Ql: Using preset IRQ %d\n", qlirq);
-
-	if (qlirq >= 0 && !request_irq(qlirq, do_ql_ihandl, 0, "qlogicfas", NULL))
-		host->can_queue = 1;
 #endif
 	hreg = scsi_host_alloc(host, 0);	/* no host data */
 	if (!hreg)
@@ -677,17 +674,23 @@
 	hreg->io_port = qbase;
 	hreg->n_io_port = 16;
 	hreg->dma_channel = -1;
-	if (qlirq != -1)
-		hreg->irq = qlirq;
+	hreg->irq = qlirq;
+	hreg->can_queue = 1;
 	INIT_LIST_HEAD(&hreg->sht_legacy_list);
 
 	sprintf(qinfo,
 		"Qlogicfas Driver version 0.46, chip %02X at %03X, IRQ %d, TPdma:%d",
 		qltyp, qbase, qlirq, QL_TURBO_PDMA);
 	host->name = qinfo;
+#ifdef QL_USE_IRQ
+	if (qlirq < 0 || request_irq(qlirq, do_ql_ihandl, 0, "qlogicfas", hreg))
+		goto free_scsi_host;
+#endif
 
 	return hreg;
 
+free_scsi_host:
+	kfree(hreg);
 err_release_mem:
 	release_region(qbase, 0x10);
 	if (host->can_queue)

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

* Re: [patch][2/3] qlogic: call request_irq() with private data
  2003-10-16  1:53 [patch][2/3] qlogic: call request_irq() with private data Aristeu Sergio Rozanski Filho
@ 2003-10-16 11:30 ` Jeff Garzik
  2003-10-16 22:32   ` Aristeu Sergio Rozanski Filho
  2003-10-17 12:01 ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2003-10-16 11:30 UTC (permalink / raw)
  To: Aristeu Sergio Rozanski Filho; +Cc: linux-kernel, Brard Roudier

Aristeu Sergio Rozanski Filho wrote:
> +#ifdef QL_USE_IRQ
> +	if (qlirq < 0 || request_irq(qlirq, do_ql_ihandl, 0, "qlogicfas", hreg))
> +		goto free_scsi_host;
> +#endif
>  
>  	return hreg;
>  
> +free_scsi_host:
> +	kfree(hreg);


should be scsi_host_put() on that last line...


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

* Re: [patch][2/3] qlogic: call request_irq() with private data
  2003-10-16 11:30 ` Jeff Garzik
@ 2003-10-16 22:32   ` Aristeu Sergio Rozanski Filho
  0 siblings, 0 replies; 4+ messages in thread
From: Aristeu Sergio Rozanski Filho @ 2003-10-16 22:32 UTC (permalink / raw)
  To: Jeff Garzik, Mike Christie; +Cc: linux-kernel, Brard Roudier

hi Jeff, Mike,

> >+free_scsi_host:
> >+	kfree(hreg);
> 
> 
> should be scsi_host_put() on that last line...

i'll fix both and resend the patches.
thanks,

-- 
aris


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

* Re: [patch][2/3] qlogic: call request_irq() with private data
  2003-10-16  1:53 [patch][2/3] qlogic: call request_irq() with private data Aristeu Sergio Rozanski Filho
  2003-10-16 11:30 ` Jeff Garzik
@ 2003-10-17 12:01 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2003-10-17 12:01 UTC (permalink / raw)
  To: Aristeu Sergio Rozanski Filho; +Cc: linux-kernel, Brard Roudier

On Wed, Oct 15, 2003 at 11:53:49PM -0200, Aristeu Sergio Rozanski Filho wrote:
> +	hreg->can_queue = 1;

We already have can_queue set in the host template, so this line is
superflous.

> +#ifdef QL_USE_IRQ
> +	if (qlirq < 0 || request_irq(qlirq, do_ql_ihandl, 0, "qlogicfas", hreg))
> +		goto free_scsi_host;
> +#endif

Does the driver work at all with QL_USE_IRQ undefined?  I don't think so
and if I'm right you should probably nuke the ifdef while you're at it.

> +free_scsi_host:
> +	kfree(hreg);

should be

#ifdef PCMCIA
	scsi_host_put(shost);
#else
	scsi_unregister(shost):
#endif

if the reworked version of the previous patch is applied.

>  	if (host->can_queue)

can_queue can't be 0 these days so this one could go away aswell.


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

end of thread, other threads:[~2003-10-17 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-16  1:53 [patch][2/3] qlogic: call request_irq() with private data Aristeu Sergio Rozanski Filho
2003-10-16 11:30 ` Jeff Garzik
2003-10-16 22:32   ` Aristeu Sergio Rozanski Filho
2003-10-17 12:01 ` Christoph Hellwig

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).