All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] Patch1:replace pci_find_device in avm_pci.c
@ 2007-02-22  5:28 Surya
  2007-02-22  6:00 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Surya @ 2007-02-22  5:28 UTC (permalink / raw)
  To: kernel-janitors

> > dev_avm_cleanup:
> > 	if (dev_avm) 
> > 		pci_dev_put(dev_avm);
> 
> Same thing here, the check isn't needed.
> 
> Care to redo it with these minor fixes?  Other than that, the logic
> looks correct.

Did the modifications and cleaned up white spaces as per your
suggestions.

thanks.

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

diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index b04a178..29f4802 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -789,19 +789,19 @@ setup_avm_pcipnp(struct IsdnCard *card)
 	}
 #endif
 #ifdef CONFIG_PCI
-	if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM,
+	if ((dev_avm = pci_get_device(PCI_VENDOR_ID_AVM,
 		PCI_DEVICE_ID_AVM_A1,  dev_avm))) {
 		if (pci_enable_device(dev_avm))
-			return(0);
+			goto dev_avm_cleanup;
 		cs->irq = dev_avm->irq;
 		if (!cs->irq) {
 			printk(KERN_ERR "FritzPCI: No IRQ for PCI card found\n");
-			return(0);
+			goto dev_avm_cleanup;
 		}
 		cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
 		if (!cs->hw.avm.cfg_reg) {
 			printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
-			return(0);
+			goto dev_avm_cleanup;
 		}
 		cs->subtyp = AVM_FRITZ_PCI;
 	} else {
@@ -822,7 +822,7 @@ ready:
 		       CardType[card->typ],
 		       cs->hw.avm.cfg_reg,
 		       cs->hw.avm.cfg_reg + 31);
-		return (0);
+		goto dev_avm_cleanup;
 	}
 	switch (cs->subtyp) {
 	  case AVM_FRITZ_PCI:
@@ -841,8 +841,8 @@ ready:
 		cs->BC_Write_Reg = &WriteHDLCPnP;
 		break;
 	  default:
-	  	printk(KERN_WARNING "AVM unknown subtype %d\n", cs->subtyp);
-	  	return(0);
+		printk(KERN_WARNING "AVM unknown subtype %d\n", cs->subtyp);
+		goto dev_avm_cleanup;
 	}
 	printk(KERN_INFO "HiSax: %s config irq:%d base:0x%X\n",
 		(cs->subtyp = AVM_FRITZ_PCI) ? "AVM Fritz!PCI" : "AVM Fritz!PnP",
@@ -858,5 +858,10 @@ ready:
 	cs->irq_func = &avm_pcipnp_interrupt;
 	cs->writeisac(cs, ISAC_MASK, 0xFF);
 	ISACVersion(cs, (cs->subtyp = AVM_FRITZ_PCI) ? "AVM PCI:" : "AVM PnP:");
+	pci_dev_put(dev_avm);
 	return (1);
+
+dev_avm_cleanup:
+	pci_dev_put(dev_avm);
+	return 0;
 }
 

-- 
surya.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] Patch1:replace pci_find_device in avm_pci.c
  2007-02-22  5:28 [KJ] Patch1:replace pci_find_device in avm_pci.c Surya
@ 2007-02-22  6:00 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2007-02-22  6:00 UTC (permalink / raw)
  To: kernel-janitors

On Thu, Feb 22, 2007 at 10:46:54AM +0530, Surya wrote:
> 
> > > dev_avm_cleanup:
> > > 	if (dev_avm) 
> > > 		pci_dev_put(dev_avm);
> > 
> > Same thing here, the check isn't needed.
> > 
> > Care to redo it with these minor fixes?  Other than that, the logic
> > looks correct.
> 
> Did the modifications and cleaned up white spaces as per your
> suggestions.
> 
> thanks.
> 
> Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2007-02-22  6:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-22  5:28 [KJ] Patch1:replace pci_find_device in avm_pci.c Surya
2007-02-22  6:00 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.