[PATCH 2/12] drivers/isdn/hisax/bkm_a4t.c: replace pci_find_device with pci_get_device

From: S.ÃaÄlar Onur
Date: Fri Jul 13 2007 - 18:45:49 EST


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

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

Signed-off-by: S.ÃaÄlar Onur <caglar@xxxxxxxxxxxxx>

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

Index: linux-2.6/drivers/isdn/hisax/bkm_a4t.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hisax/bkm_a4t.c
+++ linux-2.6/drivers/isdn/hisax/bkm_a4t.c
@@ -275,7 +275,7 @@ setup_bkm_a4t(struct IsdnCard *card)
return (0);

#ifdef CONFIG_PCI
- while ((dev_a4t = pci_find_device(PCI_VENDOR_ID_ZORAN,
+ while ((dev_a4t = pci_get_device(PCI_VENDOR_ID_ZORAN,
PCI_DEVICE_ID_ZORAN_36120, dev_a4t))) {
u16 sub_sys;
u16 sub_vendor;
@@ -284,7 +284,7 @@ setup_bkm_a4t(struct IsdnCard *card)
sub_sys = dev_a4t->subsystem_device;
if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) && (sub_vendor ==
PCI_VENDOR_ID_BERKOM)) {
if (pci_enable_device(dev_a4t))
- return(0);
+ goto dev_a4t_cleanup;
found = 1;
pci_memaddr = pci_resource_start(dev_a4t, 0);
cs->irq = dev_a4t->irq;
@@ -297,11 +297,11 @@ setup_bkm_a4t(struct IsdnCard *card)
}
if (!cs->irq) { /* IRQ range check ?? */
printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]);
- return (0);
+ goto dev_a4t_cleanup;
}
if (!pci_memaddr) {
printk(KERN_WARNING "HiSax: %s: No Memory base address\n",
CardType[card->typ]);
- return (0);
+ goto dev_a4t_cleanup;
}
cs->hw.ax.base = (long) ioremap(pci_memaddr, 4096);
/* Check suspecious address */
@@ -311,7 +311,7 @@ setup_bkm_a4t(struct IsdnCard *card)
CardType[card->typ], cs->hw.ax.base, cs->hw.ax.base + 4096);
iounmap((void *) cs->hw.ax.base);
cs->hw.ax.base = 0;
- return (0);
+ goto dev_a4t_cleanup;
}
cs->hw.ax.isac_adr = cs->hw.ax.base + PO_OFFSET;
cs->hw.ax.jade_adr = cs->hw.ax.base + PO_OFFSET;
@@ -339,5 +339,10 @@ setup_bkm_a4t(struct IsdnCard *card)
ISACVersion(cs, "Telekom A4T:");
/* Jade version */
JadeVersion(cs, "Telekom A4T:");
+ pci_dev_put(dev_a4t);
return (1);
+
+dev_a4t_cleanup:
+ pci_dev_put(dev_a4t);
+ return (0);
}

--
S.ÃaÄlar Onur <caglar@xxxxxxxxxxxxx>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/