public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "S.Çağlar Onur" <caglar@pardus.org.tr>
To: LKML <linux-kernel@vger.kernel.org>
Cc: kkeil@suse.de, kai.germaschewski@gmx.de,
	isdn4linux@listserv.isdn4linux.de
Subject: Re: [PATCH 5/12] drivers/isdn/hisax/niccy.c: replace pci_find_device with pci_get_device
Date: Sat, 14 Jul 2007 02:00:32 +0300	[thread overview]
Message-ID: <200707140200.34017.caglar@pardus.org.tr> (raw)
In-Reply-To: <200707140144.36035.caglar@pardus.org.tr>

[resend] i forget to quilt refresh :(, sorry for noise

14 Tem 2007 Cts tarihinde, S.Çağlar Onur şunları yazmıştı: 
> ---
>  drivers/isdn/hisax/niccy.c |   21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)

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

drivers/isdn/hisax/niccy.c: In function `setup_niccy':
drivers/isdn/hisax/niccy.c:305: 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/niccy.c |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

Index: linux-2.6/drivers/isdn/hisax/niccy.c
===================================================================
--- linux-2.6.orig/drivers/isdn/hisax/niccy.c
+++ linux-2.6/drivers/isdn/hisax/niccy.c
@@ -302,29 +302,29 @@ int __devinit setup_niccy(struct IsdnCar
 #ifdef CONFIG_PCI
 		u_int pci_ioaddr;
 		cs->subtyp = 0;
-		if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM,
+		if ((niccy_dev = pci_get_device(PCI_VENDOR_ID_SATSAGEM,
 						 PCI_DEVICE_ID_SATSAGEM_NICCY,
 						 niccy_dev))) {
 			if (pci_enable_device(niccy_dev))
-				return 0;
+				goto niccy_dev_cleanup;
 			/* get IRQ */
 			if (!niccy_dev->irq) {
 				printk(KERN_WARNING
 				       "Niccy: No IRQ for PCI card found\n");
-				return 0;
+				goto niccy_dev_cleanup;
 			}
 			cs->irq = niccy_dev->irq;
 			cs->hw.niccy.cfg_reg = pci_resource_start(niccy_dev, 0);
 			if (!cs->hw.niccy.cfg_reg) {
 				printk(KERN_WARNING
 				       "Niccy: No IO-Adr for PCI cfg found\n");
-				return 0;
+				goto niccy_dev_cleanup;
 			}
 			pci_ioaddr = pci_resource_start(niccy_dev, 1);
 			if (!pci_ioaddr) {
 				printk(KERN_WARNING
 				       "Niccy: No IO-Adr for PCI card found\n");
-				return 0;
+				goto niccy_dev_cleanup;
 			}
 			cs->subtyp = NICCY_PCI;
 		} else {
@@ -341,7 +341,7 @@ int __devinit setup_niccy(struct IsdnCar
 			       "HiSax: %s data port %x-%x already in use\n",
 			       CardType[card->typ],
 			       cs->hw.niccy.isac, cs->hw.niccy.isac + 4);
-			return 0;
+			goto niccy_dev_cleanup;
 		}
 		if (!request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci")) {
 			printk(KERN_WARNING
@@ -350,7 +350,7 @@ int __devinit setup_niccy(struct IsdnCar
 			       cs->hw.niccy.cfg_reg,
 			       cs->hw.niccy.cfg_reg + 0x40);
 			release_region(cs->hw.niccy.isac, 4);
-			return 0;
+			goto niccy_dev_cleanup;
 		}
 #else
 		printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
@@ -376,7 +376,12 @@ int __devinit setup_niccy(struct IsdnCar
 		printk(KERN_WARNING "Niccy: wrong HSCX versions check IO "
 			"address\n");
 		release_io_niccy(cs);
-		return 0;
+		goto niccy_dev_cleanup;
 	}
+	pci_dev_put(niccy_dev);
 	return 1;
+
+niccy_dev_cleanup:
+	pci_dev_put(niccy_dev);
+	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!

      reply	other threads:[~2007-07-13 23:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 22:44 [PATCH 5/12] drivers/isdn/hisax/niccy.c: replace pci_find_device with pci_get_device S.Çağlar Onur
2007-07-13 23:00 ` S.Çağlar Onur [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707140200.34017.caglar@pardus.org.tr \
    --to=caglar@pardus.org.tr \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=kai.germaschewski@gmx.de \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox