public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 12/12] drivers/isdn/hisax/w6692.c: replace pci_find_device with pci_get_device
@ 2007-07-13 22:44 S.Çağlar Onur
  2007-07-14  5:53 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: S.Çağlar Onur @ 2007-07-13 22:44 UTC (permalink / raw)
  To: LKML; +Cc: kkeil, kai.germaschewski, isdn4linux

Following patch replaces pci_find_device with pci_get_device to avoid 
following compiliation warning;

drivers/isdn/hisax/w6692.c: In function `setup_w6692':
drivers/isdn/hisax/w6692.c:1014: warning: `pci_find_device' is deprecated 
(declared at include/linux/pci.h:478)

and also removes trailing whitespaces at the ends of lines and converts 
smarttabs/whitespaces into real tabs

Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>

---
 drivers/isdn/hisax/w6692.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Index: linux-2.6/drivers/isdn/hisax/w6692.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hisax/w6692.c
+++ linux-2.6/drivers/isdn/hisax/w6692.c
@@ -1011,7 +1011,7 @@ setup_w6692(struct IsdnCard *card)
 		return (0);
 #ifdef CONFIG_PCI
 	while (id_list[id_idx].vendor_id) {
-		dev_w6692 = pci_find_device(id_list[id_idx].vendor_id,
+		dev_w6692 = pci_get_device(id_list[id_idx].vendor_id,
 					    id_list[id_idx].device_id,
 					    dev_w6692);
 		if (dev_w6692) {
@@ -1031,7 +1031,7 @@ setup_w6692(struct IsdnCard *card)
 		/* USR ISDN PCI card TA need some special handling */
 		if (cs->subtyp == W6692_WINBOND) {
 			if ((W6692_SV_USR == dev_w6692->subsystem_vendor) &&
-			    (W6692_SD_USR == dev_w6692->subsystem_device)) {
+				(W6692_SD_USR == dev_w6692->subsystem_device)) {
 				cs->subtyp = W6692_USR;
 			}
 		}
@@ -1043,11 +1043,11 @@ setup_w6692(struct IsdnCard *card)
 	cs->irq = pci_irq;
 	if (!cs->irq) {
 		printk(KERN_WARNING "W6692: No IRQ for PCI card found\n");
-		return (0);
+		goto dev_w6692_cleanup;
 	}
 	if (!pci_ioaddr) {
 		printk(KERN_WARNING "W6692: NO I/O Base Address found\n");
-		return (0);
+		goto dev_w6692_cleanup;
 	}
 	cs->hw.w6692.iobase = pci_ioaddr;
 	printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n",
@@ -1059,7 +1059,7 @@ setup_w6692(struct IsdnCard *card)
 		       id_list[cs->subtyp].card_name,
 		       cs->hw.w6692.iobase,
 		       cs->hw.w6692.iobase + 255);
-		return (0);
+		goto dev_w6692_cleanup;
 	}
 #else
 	printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
@@ -1089,5 +1089,10 @@ setup_w6692(struct IsdnCard *card)
 	printk(KERN_INFO "W6692 D_EXIR=0x%X\n", ReadW6692(cs, W_D_EXIR));
 	printk(KERN_INFO "W6692 D_EXIM=0x%X\n", ReadW6692(cs, W_D_EXIM));
 	printk(KERN_INFO "W6692 D_RSTA=0x%X\n", ReadW6692(cs, W_D_RSTA));
+	pci_dev_put(dev_w6692);
 	return (1);
+
+dev_w6692_cleanup:
+	pci_dev_put(dev_w6692);
+	return (0);
 }

-- 
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

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

* Re: [PATCH 12/12] drivers/isdn/hisax/w6692.c: replace pci_find_device with pci_get_device
  2007-07-13 22:44 [PATCH 12/12] drivers/isdn/hisax/w6692.c: replace pci_find_device with pci_get_device S.Çağlar Onur
@ 2007-07-14  5:53 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2007-07-14  5:53 UTC (permalink / raw)
  To: caglar; +Cc: LKML, kkeil, kai.germaschewski, isdn4linux

S.Çağlar Onur napsal(a):
> Following patch replaces pci_find_device with pci_get_device to avoid 
> following compiliation warning;
> 
> drivers/isdn/hisax/w6692.c: In function `setup_w6692':
> drivers/isdn/hisax/w6692.c:1014: warning: `pci_find_device' is deprecated 
> (declared at include/linux/pci.h:478)
> 
> and also removes trailing whitespaces at the ends of lines and converts 
> smarttabs/whitespaces into real tabs
> 
> Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
> 
> ---
>  drivers/isdn/hisax/w6692.c |   15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6/drivers/isdn/hisax/w6692.c
> ===================================================================
> --- linux-2.6.orig/drivers/isdn/hisax/w6692.c
> +++ linux-2.6/drivers/isdn/hisax/w6692.c
> @@ -1011,7 +1011,7 @@ setup_w6692(struct IsdnCard *card)
>  		return (0);
>  #ifdef CONFIG_PCI
>  	while (id_list[id_idx].vendor_id) {
> -		dev_w6692 = pci_find_device(id_list[id_idx].vendor_id,
> +		dev_w6692 = pci_get_device(id_list[id_idx].vendor_id,
>  					    id_list[id_idx].device_id,
>  					    dev_w6692);
>  		if (dev_w6692) {
> @@ -1031,7 +1031,7 @@ setup_w6692(struct IsdnCard *card)
>  		/* USR ISDN PCI card TA need some special handling */
>  		if (cs->subtyp == W6692_WINBOND) {
>  			if ((W6692_SV_USR == dev_w6692->subsystem_vendor) &&
> -			    (W6692_SD_USR == dev_w6692->subsystem_device)) {
> +				(W6692_SD_USR == dev_w6692->subsystem_device)) {
>  				cs->subtyp = W6692_USR;
>  			}
>  		}
> @@ -1043,11 +1043,11 @@ setup_w6692(struct IsdnCard *card)
>  	cs->irq = pci_irq;
>  	if (!cs->irq) {
>  		printk(KERN_WARNING "W6692: No IRQ for PCI card found\n");
> -		return (0);
> +		goto dev_w6692_cleanup;
>  	}
>  	if (!pci_ioaddr) {
>  		printk(KERN_WARNING "W6692: NO I/O Base Address found\n");
> -		return (0);
> +		goto dev_w6692_cleanup;
>  	}
>  	cs->hw.w6692.iobase = pci_ioaddr;
>  	printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n",
> @@ -1059,7 +1059,7 @@ setup_w6692(struct IsdnCard *card)
>  		       id_list[cs->subtyp].card_name,
>  		       cs->hw.w6692.iobase,
>  		       cs->hw.w6692.iobase + 255);
> -		return (0);
> +		goto dev_w6692_cleanup;
>  	}
>  #else
>  	printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
> @@ -1089,5 +1089,10 @@ setup_w6692(struct IsdnCard *card)
>  	printk(KERN_INFO "W6692 D_EXIR=0x%X\n", ReadW6692(cs, W_D_EXIR));
>  	printk(KERN_INFO "W6692 D_EXIM=0x%X\n", ReadW6692(cs, W_D_EXIM));
>  	printk(KERN_INFO "W6692 D_RSTA=0x%X\n", ReadW6692(cs, W_D_RSTA));
> +	pci_dev_put(dev_w6692);

Why do you release a reference here when you use the card all the time module is
loaded?

-- 
Jiri Slaby (jirislaby@gmail.com)
Faculty of Informatics, Masaryk University

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

end of thread, other threads:[~2007-07-14  5:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 22:44 [PATCH 12/12] drivers/isdn/hisax/w6692.c: replace pci_find_device with pci_get_device S.Çağlar Onur
2007-07-14  5:53 ` Jiri Slaby

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