* [PATCH 7/12] drivers/isdn/hisax/hfc_pci.c: replace pci_find_device with pci_get_device
@ 2007-07-13 22:44 S.Çağlar Onur
2007-07-13 23:02 ` S.Çağlar Onur
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/hfc_pci.c: In function `setup_hfcpci':
drivers/isdn/hisax/hfc_pci.c:1668: warning: `pci_find_device' is deprecated
(declared at include/linux/pci.h:478)
Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
---
drivers/isdn/hisax/hfc_pci.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Index: linux-2.6/drivers/isdn/hisax/hfc_pci.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hisax/hfc_pci.c
+++ linux-2.6/drivers/isdn/hisax/hfc_pci.c
@@ -1665,7 +1665,7 @@ setup_hfcpci(struct IsdnCard *card)
if (cs->typ == ISDN_CTYPE_HFC_PCI) {
i = 0;
while (id_list[i].vendor_id) {
- tmp_hfcpci = pci_find_device(id_list[i].vendor_id,
+ tmp_hfcpci = pci_get_device(id_list[i].vendor_id,
id_list[i].device_id,
dev_hfcpci);
i++;
@@ -1687,7 +1687,7 @@ setup_hfcpci(struct IsdnCard *card)
cs->irq = dev_hfcpci->irq;
if (!cs->irq) {
printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
- return (0);
+ goto tmp_hfcpci_cleanup;
}
cs->hw.hfcpci.pci_io = (char *)(unsigned
long)dev_hfcpci->resource[1].start;
printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n",
id_list[i].vendor_name, id_list[i].card_name);
@@ -1697,14 +1697,14 @@ setup_hfcpci(struct IsdnCard *card)
}
if (!cs->hw.hfcpci.pci_io) {
printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
- return (0);
+ goto tmp_hfcpci_cleanup;
}
/* Allocate memory for FIFOS */
/* Because the HFC-PCI needs a 32K physical alignment, we */
/* need to allocate the double mem and align the address */
if (!(cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) {
printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
- return 0;
+ goto tmp_hfcpci_cleanup;
}
cs->hw.hfcpci.fifos = (void *)
(((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
@@ -1741,9 +1741,14 @@ setup_hfcpci(struct IsdnCard *card)
cs->cardmsg = &hfcpci_card_msg;
cs->auxcmd = &hfcpci_auxcmd;
spin_unlock_irqrestore(&cs->lock, flags);
+ pci_dev_put(tmp_hfcpci);
return (1);
} else
return (0); /* no valid card type */
+
+tmp_hfcpci_cleanup:
+ pci_put_dev(tmp_hfcpci);
+ return (0);
#else
printk(KERN_WARNING "HFC-PCI: NO_PCI_BIOS\n");
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 7/12] drivers/isdn/hisax/hfc_pci.c: replace pci_find_device with pci_get_device
2007-07-13 22:44 [PATCH 7/12] drivers/isdn/hisax/hfc_pci.c: replace pci_find_device with pci_get_device S.Çağlar Onur
@ 2007-07-13 23:02 ` S.Çağlar Onur
0 siblings, 0 replies; 2+ messages in thread
From: S.Çağlar Onur @ 2007-07-13 23:02 UTC (permalink / raw)
To: LKML; +Cc: kkeil, kai.germaschewski, isdn4linux
[resend] i forget to quilt refresh :(, sorry for noise
14 Tem 2007 Cts tarihinde, S.Çağlar Onur şunları yazmıştı:
> ---
> drivers/isdn/hisax/hfc_pci.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
Following patch replaces pci_find_device with pci_get_device to avoid
following compiliation warning;
drivers/isdn/hisax/hfc_pci.c: In function `setup_hfcpci':
drivers/isdn/hisax/hfc_pci.c:1668: warning: `pci_find_device' is deprecated
(declared at include/linux/pci.h:478)
Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
---
drivers/isdn/hisax/hfc_pci.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Index: linux-2.6/drivers/isdn/hisax/hfc_pci.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hisax/hfc_pci.c
+++ linux-2.6/drivers/isdn/hisax/hfc_pci.c
@@ -1665,7 +1665,7 @@ setup_hfcpci(struct IsdnCard *card)
if (cs->typ == ISDN_CTYPE_HFC_PCI) {
i = 0;
while (id_list[i].vendor_id) {
- tmp_hfcpci = pci_find_device(id_list[i].vendor_id,
+ tmp_hfcpci = pci_get_device(id_list[i].vendor_id,
id_list[i].device_id,
dev_hfcpci);
i++;
@@ -1687,7 +1687,7 @@ setup_hfcpci(struct IsdnCard *card)
cs->irq = dev_hfcpci->irq;
if (!cs->irq) {
printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
- return (0);
+ goto tmp_hfcpci_cleanup;
}
cs->hw.hfcpci.pci_io = (char *)(unsigned
long)dev_hfcpci->resource[1].start;
printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n",
id_list[i].vendor_name, id_list[i].card_name);
@@ -1697,14 +1697,14 @@ setup_hfcpci(struct IsdnCard *card)
}
if (!cs->hw.hfcpci.pci_io) {
printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
- return (0);
+ goto tmp_hfcpci_cleanup;
}
/* Allocate memory for FIFOS */
/* Because the HFC-PCI needs a 32K physical alignment, we */
/* need to allocate the double mem and align the address */
if (!(cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) {
printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
- return 0;
+ goto tmp_hfcpci_cleanup;
}
cs->hw.hfcpci.fifos = (void *)
(((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
@@ -1741,9 +1741,14 @@ setup_hfcpci(struct IsdnCard *card)
cs->cardmsg = &hfcpci_card_msg;
cs->auxcmd = &hfcpci_auxcmd;
spin_unlock_irqrestore(&cs->lock, flags);
+ pci_dev_put(tmp_hfcpci);
return (1);
} else
return (0); /* no valid card type */
+
+tmp_hfcpci_cleanup:
+ pci_dev_put(tmp_hfcpci);
+ return (0);
#else
printk(KERN_WARNING "HFC-PCI: NO_PCI_BIOS\n");
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
end of thread, other threads:[~2007-07-13 23:02 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 7/12] drivers/isdn/hisax/hfc_pci.c: replace pci_find_device with pci_get_device S.Çağlar Onur
2007-07-13 23:02 ` S.Çağlar Onur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox